| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | public function getAccountsArray() |
||
| 22 | { |
||
| 23 | $accounts = $this->findSegments(static::SEG_ACCOUNT_INFORMATION); |
||
| 24 | |||
| 25 | foreach ($accounts as $account) { |
||
|
|
|||
| 26 | $accountParts = $this->splitSegment($account); |
||
| 27 | $this->accounts[] = $this->createModelFromArray($accountParts); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $this->accounts; |
||
| 31 | } |
||
| 32 | |||
| 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.