当前位置: 首页>>代码示例>>PHP>>正文


PHP Assertion::email方法代码示例

本文整理汇总了PHP中Assert\Assertion::email方法的典型用法代码示例。如果您正苦于以下问题:PHP Assertion::email方法的具体用法?PHP Assertion::email怎么用?PHP Assertion::email使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assert\Assertion的用法示例。


在下文中一共展示了Assertion::email方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * @param string $value
  */
 private function __construct($value)
 {
     if (!empty($value)) {
         Guard::email($value, 'Email Address is invalid');
     }
     $this->value = $value;
 }
开发者ID:gingerpayments,项目名称:ginger-php,代码行数:10,代码来源:EmailAddress.php

示例2: setEmail

 /**
  * @param $email
  */
 protected function setEmail($email)
 {
     $email = trim($email);
     if (!$email) {
         throw new \InvalidArgumentException('email');
     }
     Assertion::email($email);
     $this->email = strtolower($email);
 }
开发者ID:dddinphp,项目名称:last-wishes,代码行数:12,代码来源:User.php

示例3: register

 /**
  * @param $name
  * @param $email
  * @param $password
  * @return User
  */
 public function register($name, $email, $password)
 {
     Assertion::string($name);
     Assertion::email($email);
     $password = bcrypt($password);
     $user = User::register($name, $email, $password);
     $this->users->add($user);
     return $user;
 }
开发者ID:vuongtrannguyenkhoi,项目名称:aria,代码行数:15,代码来源:UserServices.php

示例4: setEmail

 /**
  * @param $email
  */
 private function setEmail($email)
 {
     $email = trim($email);
     if (!$email) {
         throw new \InvalidArgumentException('Email cannot be empty');
     }
     Assertion::email($email);
     $this->email = strtolower($email);
 }
开发者ID:xdimedrolx,项目名称:last-wishes,代码行数:12,代码来源:WishEmail.php

示例5: __construct

 public function __construct($value)
 {
     try {
         Assertion::email($value);
         $this->value = $value;
     } catch (AssertionInvalidArgumentException $exception) {
         throw new InvalidArgumentException($value, array('email'));
     }
 }
开发者ID:lorenzomar,项目名称:valueobject,代码行数:9,代码来源:Email.php

示例6: __construct

 /**
  * @param int $gender
  * @param string $firstName
  * @param string $lastName
  * @param string $email
  */
 public function __construct($gender, $firstName, $lastName, $email)
 {
     Assertion::choice($gender, [self::GENDER_MALE, self::GENDER_FEMALE]);
     Assertion::notEmpty($firstName);
     Assertion::notEmpty($lastName);
     Assertion::email($email);
     $this->gender = $gender;
     $this->firstName = $firstName;
     $this->lastName = $lastName;
     $this->email = $email;
 }
开发者ID:palya-framework,项目名称:palya,代码行数:17,代码来源:CustomerName.php

示例7: __construct

 /**
  * Create a new Email
  *
  * @param string $value
  * @return void
  */
 public function __construct($value)
 {
     Assertion::email($value);
     $this->value = $value;
 }
开发者ID:alle,项目名称:cribbb,代码行数:11,代码来源:Email.php

示例8: testValidEmail

 public function testValidEmail()
 {
     Assertion::email("123hello+world@email.provider.com");
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:4,代码来源:AssertTest.php

示例9: __construct

 public function __construct($email)
 {
     Assertion::email($email, "Invalid email address {$email}");
     $this->email = $email;
 }
开发者ID:domynation,项目名称:domynation-framework,代码行数:5,代码来源:Email.php

示例10: __construct

 /**
  * @param string $email
  */
 public function __construct($email)
 {
     Assertion::email($email);
     $this->email = $email;
 }
开发者ID:jonasdekeukelaere,项目名称:email,代码行数:8,代码来源:Email.php

示例11: setCustomerEmail

 /**
  * Sets the customer email
  *
  * @param string $customerEmail
  */
 public function setCustomerEmail($customerEmail)
 {
     Assertion::email($customerEmail);
     $this->customerEmail = $customerEmail;
 }
开发者ID:indigophp,项目名称:service-application,代码行数:10,代码来源:Service.php

示例12: setEmail

 /**
  * @param string $email
  */
 public function setEmail($email)
 {
     if (null === $email) {
         throw new \InvalidArgumentException('email');
     }
     Assertion::email($email);
     $this->email = $email;
 }
开发者ID:basuritas-php,项目名称:aldiges,代码行数:11,代码来源:User.php

示例13: setEmail

 /**
  * @param mixed $email
  */
 public function setEmail($email)
 {
     Assertion::email($email);
     $this->email = $email;
 }
开发者ID:ymnl007,项目名称:Usher,代码行数:8,代码来源:Email.php

示例14: setAddress

 /**
  * The address is validated before setting it
  *
  * @param $address
  */
 protected function setAddress($address)
 {
     Assertion::email($address, "{$address} is not a valid email address");
     $this->address = $address;
 }
开发者ID:zoek1,项目名称:php-testing-tools,代码行数:10,代码来源:Email.php


注:本文中的Assert\Assertion::email方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。