1 | <?php |
||
8 | class CountryRepository |
||
9 | { |
||
10 | /** @var Country[] $countries */ |
||
11 | private $countries; |
||
12 | |||
13 | /** |
||
14 | * CountryRepository constructor. |
||
15 | */ |
||
16 | 1 | public function __construct() |
|
20 | |||
21 | /** |
||
22 | * @return Country[] |
||
23 | */ |
||
24 | public function findAllCountries(): array |
||
34 | |||
35 | /** |
||
36 | * @param string $id |
||
37 | * @return Country |
||
38 | * @throws CountryException |
||
39 | */ |
||
40 | 3 | public function findCountryByIsoCode(string $id): Country |
|
48 | |||
49 | /** |
||
50 | * @param string $id |
||
51 | * @return Country |
||
52 | * @throws CountryException |
||
53 | */ |
||
54 | public function findCountryBy(string $key, string $value): Country |
||
64 | |||
65 | /** |
||
66 | * @param array $data |
||
67 | * @return Country |
||
68 | */ |
||
69 | public function createFromArray(array $data): Country |
||
81 | } |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: