/** * @param UserEmail $email * * @return User|null */ public function findByEmail(UserEmail $email) { if ($userEntity = $this->userRepository->findOneByEmail($email->toString())) { return $this->transformPDOEntityToUser($userEntity); } return false; }
/** * @test */ public function validEmailIsProperlySetAndRetrieved() { $emailString = '*****@*****.**'; $email = new UserEmail($emailString); $this->assertEquals($emailString, $email->toString()); }
/** * @param UserUuid $userUuid * @param UserName $userName * @param UserEmail $email */ public function __construct(UserUuid $userUuid, UserName $userName, UserEmail $email) { $this->userUuid = $userUuid->toString(); $this->userName = $userName->toString(); $this->userEmail = $email->toString(); }