| 1 | <?php |
||
| 16 | class ValueObject implements ValueObjectInterface |
||
| 17 | {
|
||
| 18 | /** |
||
| 19 | * @var \ReflectionClass |
||
| 20 | */ |
||
| 21 | protected $reflection; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @var mixed |
||
| 25 | */ |
||
| 26 | protected $value; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Class Constructor |
||
| 30 | */ |
||
| 31 | 107 | public function __construct($value) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | 1 | public function getShortName() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @param $field |
||
| 47 | * @param $value |
||
| 48 | */ |
||
| 49 | 1 | public function __set($field, $value) |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | 1 | public function hash() |
|
| 63 | |||
| 64 | /** |
||
| 65 | * @param $object |
||
| 66 | * @return mixed |
||
|
|
|||
| 67 | */ |
||
| 68 | 1 | public function cloneObject($object) |
|
| 72 | |||
| 73 | /** |
||
| 74 | * @param $string |
||
| 75 | * @return static |
||
| 76 | */ |
||
| 77 | public static function fromString($string) |
||
| 78 | {
|
||
| 79 | return new static((string) $string); |
||
| 80 | } |
||
| 81 | |||
| 82 | /** |
||
| 83 | * @return mixed |
||
| 84 | */ |
||
| 85 | 81 | public function getValue() |
|
| 89 | |||
| 90 | /** |
||
| 91 | * @return string |
||
| 92 | */ |
||
| 93 | 30 | public function __toString() |
|
| 97 | |||
| 98 | /** |
||
| 99 | * @param ValueObject $object |
||
| 100 | * @return bool |
||
| 101 | */ |
||
| 102 | public function equals(ValueObject $object) |
||
| 106 | } |
||
| 107 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.