-
-
Save mdzwigala/6494187571151b0e873e5172eba4ab57 to your computer and use it in GitHub Desktop.
ADR-EXAMPLE/Domain/User
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
declare(strict_types=1); | |
namespace App\Domain\Model; | |
final class User | |
{ | |
private string $email; | |
private string $encodedPassword; | |
private string $id; | |
public function __construct(string $email, string $encodedPassword) | |
{ | |
$this->id = uniqid(); | |
$this->email = $email; | |
$this->changePassword($encodedPassword); | |
} | |
public function id(): string | |
{ | |
return $this->id; | |
} | |
public function email(): string | |
{ | |
return $this->email; | |
} | |
public function changePassword(string $encodedPassword): void | |
{ | |
$this->encodedPassword = $encodedPassword; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment