| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 64 | public function createFromArray(array $data): Country |
||
| 65 | { |
||
| 66 | $country = new Country(); |
||
| 67 | $country->setId($data['id']) |
||
| 68 | ->setIso($data['iso']) |
||
| 69 | ->setName($data['name']) |
||
| 70 | ->setCountry($data['country']) |
||
| 71 | ->setNumCode($data['numcode']) |
||
| 72 | ->setFlag($data['flag']); |
||
| 73 | |||
| 74 | return $country; |
||
| 75 | } |
||
| 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: