Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
39 | protected function createModelFromArray(array $array) |
||
40 | { |
||
41 | $account = new Account(); |
||
42 | list($accountNumber, $x, $countryCode, $bankCode) = explode(':', $array[1]); |
||
43 | $account->setId($array[1]); |
||
44 | $account->setAccountNumber($accountNumber); |
||
45 | $account->setBankCode($bankCode); |
||
46 | $account->setIban($array[2]); |
||
47 | $account->setCustomerId($array[3]); |
||
48 | $account->setCurrency($array[5]); |
||
49 | $account->setAccountOwnerName($array[6]); |
||
50 | $account->setAccountDescription($array[8]); |
||
51 | |||
52 | return $account; |
||
53 | } |
||
54 | } |
||
55 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.