1 | <?php |
||
15 | class ValueObject extends BaseStruct |
||
16 | { |
||
17 | /** |
||
18 | * ValueObject constructor. |
||
19 | * @param iterable $attributes |
||
20 | */ |
||
21 | public function __construct(iterable $attributes = []) |
||
25 | |||
26 | /** |
||
27 | * @param iterable $attributes |
||
28 | */ |
||
29 | public function setAttributes(iterable $attributes): void |
||
35 | |||
36 | /** |
||
37 | * @param string|int $attribute |
||
38 | * @param mixed $value |
||
39 | * @return void |
||
40 | */ |
||
41 | public function set($attribute, $value): void |
||
45 | |||
46 | /** |
||
47 | * @return array |
||
48 | */ |
||
49 | public function toArray(): array |
||
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getAttributes(): array |
||
63 | |||
64 | /** |
||
65 | * @param string|int $attribute |
||
66 | * @return mixed|null |
||
67 | */ |
||
68 | public function __get($attribute) |
||
72 | |||
73 | /** |
||
74 | * @param string|int $attribute |
||
75 | * @param mixed $value |
||
76 | */ |
||
77 | public function __set($attribute, $value) |
||
81 | |||
82 | /** |
||
83 | * @param string|int $attribute |
||
84 | * @return mixed|null |
||
85 | */ |
||
86 | public function get($attribute) |
||
90 | |||
91 | /** |
||
92 | * @return array |
||
93 | */ |
||
94 | public function jsonSerialize(): array |
||
98 | } |
||
99 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.