Total Complexity | 7 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | abstract class AbstractCollection implements Countable, IteratorAggregate |
||
18 | { |
||
19 | /** |
||
20 | * @param stdClass $content |
||
21 | * @return TItem |
||
|
|||
22 | */ |
||
23 | abstract protected function createItemFromStdClass(stdClass $content): object; |
||
24 | |||
25 | /** @var ArrayObject<int, TItem> */ |
||
26 | protected $collection; |
||
27 | |||
28 | /** @param array<stdClass> $collection */ |
||
29 | 85 | public function __construct(array $collection) |
|
30 | { |
||
31 | 85 | $this->collection = new ArrayObject(); |
|
32 | 85 | foreach ($collection as $content) { |
|
33 | 59 | $this->collection->append($this->createItemFromStdClass($content)); |
|
34 | } |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param int $index |
||
39 | * @return TItem |
||
40 | */ |
||
41 | 16 | public function get(int $index): object |
|
47 | } |
||
48 | |||
49 | 37 | public function count(): int |
|
50 | { |
||
51 | 37 | return $this->collection->count(); |
|
52 | } |
||
53 | |||
54 | /** @return TItem */ |
||
55 | 9 | public function first(): object |
|
58 | } |
||
59 | |||
60 | /** @return ArrayIterator<int, TItem> */ |
||
61 | 43 | public function getIterator(): ArrayIterator |
|
64 | } |
||
65 | } |
||
66 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths