| Conditions | 2 |
| Paths | 2 |
| Total Lines | 24 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 5 | public function loadPlanilhasNotProcesseds() { |
||
| 6 | $planilhas = $this->find('all', array( |
||
| 7 | array('conditions' => array( |
||
| 8 | array('OR' => array( |
||
| 9 | 'QueueProduct.processado' => 0, |
||
| 10 | 'QueueProduct.processado' => 2 |
||
| 11 | ) |
||
| 12 | ) |
||
| 13 | ) |
||
| 14 | ) |
||
| 15 | ) |
||
| 16 | ); |
||
| 17 | |||
| 18 | $response = []; |
||
| 19 | foreach ($planilhas as $planilha) { |
||
|
|
|||
| 20 | $response[] = [ |
||
| 21 | 'caminho' => $planilha['QueueProduct']['caminho'], |
||
| 22 | 'usuario_id' => $planilha['QueueProduct']['usuario_id'], |
||
| 23 | 'id' => $planilha['QueueProduct']['id'] |
||
| 24 | ]; |
||
| 25 | } |
||
| 26 | |||
| 27 | return $response; |
||
| 28 | } |
||
| 29 | |||
| 44 | } |
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.