當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。