1 | <?php |
||
18 | abstract class ValueObject implements ValueObjectInterface |
||
|
|||
19 | { |
||
20 | /** |
||
21 | * @var mixed |
||
22 | */ |
||
23 | protected $value; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $type; |
||
29 | |||
30 | /** |
||
31 | * ValueObject constructor. |
||
32 | * |
||
33 | * @param $value |
||
34 | */ |
||
35 | 200 | public function __construct($value) |
|
40 | |||
41 | /** |
||
42 | * @return mixed |
||
43 | */ |
||
44 | 171 | public function getValue() |
|
48 | |||
49 | /** |
||
50 | * @param $field |
||
51 | * @param $value |
||
52 | * @throws \RuntimeException |
||
53 | * @return void |
||
54 | */ |
||
55 | 1 | public function __set($field, $value) |
|
61 | |||
62 | /** |
||
63 | * @return string |
||
64 | */ |
||
65 | 31 | public function __toString() |
|
69 | |||
70 | /** |
||
71 | * @return string |
||
72 | */ |
||
73 | public function getType() |
||
77 | |||
78 | /** |
||
79 | * @return string |
||
80 | */ |
||
81 | 1 | public function hash() |
|
85 | |||
86 | /** |
||
87 | * @param ValueObjectInterface $object |
||
88 | * @return bool |
||
89 | */ |
||
90 | 2 | public function equals(ValueObjectInterface $object) |
|
94 | |||
95 | /** |
||
96 | * @inheritdoc |
||
97 | */ |
||
98 | 190 | public function __destruct() |
|
102 | } |
||
103 |
This check examines a number of code elements and verifies that they conform to the given naming conventions.
You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.