1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace VasilDakov\Econt\Response; |
||
6 | |||
7 | use Doctrine\Common\Collections\ArrayCollection; |
||
8 | use JMS\Serializer\Annotation as Serializer; |
||
9 | use VasilDakov\Econt\Model; |
||
10 | |||
11 | final class GetCitiesResponse |
||
12 | { |
||
13 | #[Serializer\Type("ArrayCollection<VasilDakov\Econt\Model\City>")] |
||
14 | private ArrayCollection $cities; |
||
15 | |||
16 | 2 | public function __construct() |
|
17 | { |
||
18 | 2 | $this->cities = new ArrayCollection(); |
|
19 | } |
||
20 | |||
21 | 2 | public function findById(int $id): ?Model\City |
|
0 ignored issues
–
show
|
|||
22 | { |
||
23 | 2 | $collection = $this->cities->filter(function (Model\City $city) use ($id) { |
|
24 | 2 | return $city->id === $id; |
|
25 | 2 | }); |
|
26 | |||
27 | 2 | return (!$collection->isEmpty()) ? $collection->first() : null; |
|
28 | } |
||
29 | |||
30 | 2 | public function findByName(string $name): ?Model\City |
|
31 | { |
||
32 | 2 | $collection = $this->cities->filter(function (Model\City $city) use ($name) { |
|
33 | 2 | return $city->name === $name; |
|
34 | 2 | }); |
|
35 | |||
36 | 2 | return (!$collection->isEmpty()) ? $collection->first() : null; |
|
37 | } |
||
38 | } |
||
39 |
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