| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 27 | 4 | protected function getEntityListFromDataSet($dataList) |
|
| 28 | { |
||
| 29 | 4 | $entityList = false; |
|
| 30 | |||
| 31 | 4 | if (!empty($dataList)) { |
|
| 32 | 4 | foreach ($dataList as $entityData) { |
|
|
|
|||
| 33 | /** @var DataEntityInterface $entity */ |
||
| 34 | 4 | $entity = $this->createEntity(); |
|
| 35 | 4 | $this->populateEntity($entity, $entityData); |
|
| 36 | 4 | $entityList[] = $entity; |
|
| 37 | 4 | } |
|
| 38 | 4 | } |
|
| 39 | |||
| 40 | 4 | return $entityList; |
|
| 41 | } |
||
| 42 | } |
||
| 43 |
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.