/** * @param string $value */ private function __construct($value) { if (!empty($value)) { Guard::email($value, 'Email Address is invalid'); } $this->value = $value; }
/** * @param $email */ protected function setEmail($email) { $email = trim($email); if (!$email) { throw new \InvalidArgumentException('email'); } Assertion::email($email); $this->email = strtolower($email); }
/** * @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; }
/** * @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); }
public function __construct($value) { try { Assertion::email($value); $this->value = $value; } catch (AssertionInvalidArgumentException $exception) { throw new InvalidArgumentException($value, array('email')); } }
/** * @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; }
/** * Create a new Email * * @param string $value * @return void */ public function __construct($value) { Assertion::email($value); $this->value = $value; }
public function testValidEmail() { Assertion::email("*****@*****.**"); }
public function __construct($email) { Assertion::email($email, "Invalid email address {$email}"); $this->email = $email; }
/** * @param string $email */ public function __construct($email) { Assertion::email($email); $this->email = $email; }
/** * Sets the customer email * * @param string $customerEmail */ public function setCustomerEmail($customerEmail) { Assertion::email($customerEmail); $this->customerEmail = $customerEmail; }
/** * @param string $email */ public function setEmail($email) { if (null === $email) { throw new \InvalidArgumentException('email'); } Assertion::email($email); $this->email = $email; }
/** * @param mixed $email */ public function setEmail($email) { Assertion::email($email); $this->email = $email; }
/** * 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; }