1 | <?php |
||
15 | class ValueObject implements |
||
16 | \ArrayAccess, |
||
17 | \Serializable, |
||
18 | \JsonSerializable, |
||
19 | DefinitionValueObject |
||
20 | { |
||
21 | /** |
||
22 | * @var array|mixed[] |
||
23 | */ |
||
24 | protected $attributes = []; |
||
25 | |||
26 | /** |
||
27 | * ValueObject constructor. |
||
28 | * @param array $attributes |
||
29 | */ |
||
30 | public function __construct(array $attributes = []) |
||
40 | |||
41 | /** |
||
42 | * @param string $name |
||
43 | * @param mixed $value |
||
44 | */ |
||
45 | public function set(string $name, $value): void |
||
49 | |||
50 | /** |
||
51 | * @param string $name |
||
52 | * @return mixed|null |
||
53 | */ |
||
54 | public function __get(string $name) |
||
58 | |||
59 | /** |
||
60 | * @param string $name |
||
61 | * @param mixed $value |
||
62 | * @return void |
||
63 | */ |
||
64 | public function __set(string $name, $value): void |
||
68 | |||
69 | /** |
||
70 | * @param string $name |
||
71 | * @return mixed|null |
||
72 | */ |
||
73 | public function get(string $name) |
||
77 | |||
78 | /** |
||
79 | * @param string $name |
||
80 | * @return bool |
||
81 | */ |
||
82 | protected function has(string $name): bool |
||
86 | |||
87 | /** |
||
88 | * @param string $name |
||
89 | * @return bool |
||
90 | */ |
||
91 | protected function delete(string $name): bool |
||
101 | |||
102 | /** |
||
103 | * @param string $name |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function __isset(string $name): bool |
||
110 | |||
111 | /** |
||
112 | * @param string $name |
||
113 | * @return void |
||
114 | */ |
||
115 | public function __unset(string $name): void |
||
119 | |||
120 | /** |
||
121 | * @return array |
||
122 | */ |
||
123 | public function jsonSerialize(): array |
||
142 | |||
143 | /** |
||
144 | * @return string |
||
145 | */ |
||
146 | public function serialize(): string |
||
150 | |||
151 | /** |
||
152 | * @param string $serialized |
||
153 | */ |
||
154 | public function unserialize($serialized): void |
||
160 | |||
161 | /** |
||
162 | * @param string|int $offset |
||
163 | * @return bool |
||
164 | */ |
||
165 | public function offsetExists($offset): bool |
||
169 | |||
170 | /** |
||
171 | * @param string|int $offset |
||
172 | * @return mixed|null |
||
173 | */ |
||
174 | public function offsetGet($offset) |
||
178 | |||
179 | /** |
||
180 | * @param string|int $offset |
||
181 | * @param mixed $value |
||
182 | */ |
||
183 | public function offsetSet($offset, $value): void |
||
191 | |||
192 | /** |
||
193 | * @param string|int $offset |
||
194 | */ |
||
195 | public function offsetUnset($offset): void |
||
199 | } |
||
200 |
This error could be the result of:
1. Missing dependencies
PHP Analyzer uses your
composer.json
file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects thecomposer.json
to be in the root folder of your repository.Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the
require
orrequire-dev
section?2. Missing use statement
PHP does not complain about undefined classes in
ìnstanceof
checks. For example, the following PHP code will work perfectly fine:If you have not tested against this specific condition, such errors might go unnoticed.