| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function provideTestParseAndDump() |
||
| 12 | { |
||
| 13 | $iter = new RecursiveIteratorIterator( |
||
| 14 | new RecursiveDirectoryIterator( |
||
| 15 | __DIR__ . '/../compiling-fixtures' |
||
| 16 | ), |
||
| 17 | RecursiveIteratorIterator::LEAVES_ONLY |
||
| 18 | ); |
||
| 19 | |||
| 20 | foreach ($iter as $file) { |
||
| 21 | if (!$file->isFile()) { |
||
| 22 | continue; |
||
| 23 | } |
||
| 24 | |||
| 25 | $contents = file_get_contents($file); |
||
| 26 | yield $file->getBasename() => explode('----------------------------', $contents); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 59 |
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.