1 | <?php |
||
9 | abstract class ListResource extends Resource implements \ArrayAccess, \IteratorAggregate, \Countable |
||
10 | { |
||
11 | use CreateResource; |
||
12 | |||
13 | /** @var ResourceCollection */ |
||
14 | protected $collection; |
||
15 | |||
16 | /** @var array */ |
||
17 | private $query; |
||
18 | |||
19 | /** {@inheritdoc} */ |
||
20 | public function __construct(Transport $transport, $uri) |
||
25 | |||
26 | protected function reset() |
||
31 | |||
32 | /** |
||
33 | * @param string $id |
||
34 | * |
||
35 | * @return InstanceResource |
||
36 | */ |
||
37 | public function get($id) |
||
46 | |||
47 | /** |
||
48 | * @param string $id |
||
49 | * |
||
50 | * @return bool |
||
51 | */ |
||
52 | public function delete($id) |
||
59 | |||
60 | /** |
||
61 | * @param array $query |
||
62 | * |
||
63 | * @return ResourceCollection |
||
64 | */ |
||
65 | public function all($query = []) |
||
81 | |||
82 | /** {@inheritdoc} */ |
||
83 | public function count() |
||
89 | |||
90 | /** |
||
91 | * @return ResourceCollection |
||
92 | */ |
||
93 | public function getIterator() |
||
99 | |||
100 | /** |
||
101 | * @param array $data |
||
102 | * |
||
103 | * @return ResourceCollection |
||
104 | */ |
||
105 | protected function postAll(array $data) |
||
116 | |||
117 | /** {@inheritdoc} */ |
||
118 | public function offsetExists($offset) |
||
124 | |||
125 | /** {@inheritdoc} */ |
||
126 | public function offsetGet($offset) |
||
132 | |||
133 | /** {@inheritdoc} */ |
||
134 | public function offsetSet($offset, $value) |
||
140 | |||
141 | /** {@inheritdoc} */ |
||
142 | public function offsetUnset($offset) |
||
148 | } |
||
149 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.