1 | <?php |
||
11 | class ArrayAttribute extends AbstractAttribute implements \Countable, \IteratorAggregate, \ArrayAccess |
||
12 | { |
||
13 | protected $default = []; |
||
14 | |||
15 | /** |
||
16 | * Required by DelegatedArrayTrait, must return the |
||
17 | * storage array. |
||
18 | */ |
||
19 | public function getDelegatedStorage() |
||
25 | |||
26 | protected function get() |
||
30 | |||
31 | protected function set($arguments) |
||
36 | |||
37 | // --- cast |
||
38 | |||
39 | protected function castToArray($array) |
||
66 | |||
67 | // --- Array methods |
||
68 | |||
69 | public function count() |
||
73 | |||
74 | public function offsetExists($name) |
||
78 | |||
79 | public function offsetSet($name, $value) |
||
85 | |||
86 | public function offsetUnset($name) |
||
90 | |||
91 | public function offsetGet($name) |
||
95 | |||
96 | /** |
||
97 | * (PHP 5 >= 5.0.0)<br/> |
||
98 | * Retrieve an external iterator. |
||
99 | * |
||
100 | * @link http://php.net/manual/en/iteratoraggregate.getiterator.php |
||
101 | * |
||
102 | * @return Traversable An instance of an object implementing <b>Iterator</b> or |
||
103 | * <b>Traversable</b> |
||
104 | */ |
||
105 | public function getIterator() |
||
109 | |||
110 | public function toArray() |
||
114 | |||
115 | public function exchangeArray($array) |
||
120 | } |
||
121 |
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.