| 1 | <?php  | 
            ||
| 8 | final class Surname implements Serializable  | 
            ||
| 9 | { | 
            ||
| 10 | /**  | 
            ||
| 11 | * @var string  | 
            ||
| 12 | */  | 
            ||
| 13 | private $surname;  | 
            ||
| 14 | |||
| 15 | /**  | 
            ||
| 16 | * @param string $name  | 
            ||
| 17 | */  | 
            ||
| 18 | public function __construct($name)  | 
            ||
| 19 |     { | 
            ||
| 20 | Assertion::nonEmptyString($name, 'name');  | 
            ||
| 21 | |||
| 22 | $this->surname = $name;  | 
            ||
| 23 | }  | 
            ||
| 24 | |||
| 25 | /**  | 
            ||
| 26 | * @param Surname $other  | 
            ||
| 27 | * @return bool  | 
            ||
| 28 | */  | 
            ||
| 29 | public function equals(Surname $other)  | 
            ||
| 30 |     { | 
            ||
| 31 | return $this->surname === $other->surname;  | 
            ||
| 32 | }  | 
            ||
| 33 | |||
| 34 | /**  | 
            ||
| 35 | * @return string  | 
            ||
| 36 | */  | 
            ||
| 37 | public function getSurname()  | 
            ||
| 38 |     { | 
            ||
| 39 | return $this->surname;  | 
            ||
| 40 | }  | 
            ||
| 41 | |||
| 42 | public static function deserialize($data)  | 
            ||
| 46 | |||
| 47 | public function serialize()  | 
            ||
| 51 | |||
| 52 | public function __toString()  | 
            ||
| 53 |     { | 
            ||
| 54 | return $this->surname;  | 
            ||
| 56 | }  | 
            ||
| 57 |