1 | <?php |
||
8 | class CountryRepository |
||
9 | { |
||
10 | /** @var Country[] $countries */ |
||
11 | private $countries; |
||
12 | |||
13 | /** |
||
14 | * CountryRepository constructor. |
||
15 | */ |
||
16 | public function __construct() |
||
20 | |||
21 | public function findAllCountries() |
||
29 | |||
30 | /** |
||
31 | * @param string $id |
||
32 | * @return Country |
||
33 | * @throws CountryException |
||
34 | */ |
||
35 | public function findCountryById(string $id): Country |
||
43 | |||
44 | /** |
||
45 | * @param string $id |
||
46 | * @return Country |
||
47 | * @throws CountryException |
||
48 | */ |
||
49 | public function findCountryBy(string $key, string $value): Country |
||
59 | |||
60 | /** |
||
61 | * @param array $data |
||
62 | * @return Country |
||
63 | */ |
||
64 | public function createFromArray(array $data): Country |
||
76 | } |
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: