| 1 | <?php |
||
| 11 | class Address |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var string $address |
||
| 15 | */ |
||
| 16 | protected $address; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var string $name |
||
| 20 | */ |
||
| 21 | private $name; |
||
| 22 | |||
| 23 | public function __construct(string $address, string $name = '') |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | public function getAddress(): string |
||
| 33 | { |
||
| 34 | return $this->address; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function getName(): string |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return boolean |
||
| 47 | */ |
||
| 48 | public function isValid(): bool |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Checks, if the given addresses are equal. this only includes the address, the name is being ignored |
||
| 55 | * |
||
| 56 | * @param Address $address |
||
| 57 | * |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | public function equals(Address $address): bool |
||
| 64 | |||
| 65 | } |