Total Complexity | 5 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
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 |
|
|
|||
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 |
|
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