Conditions | 3 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | protected function execute(InputInterface $input, OutputInterface $output) |
||
32 | { |
||
33 | $sourceFiles = $this->getContainer()->get(array('z', 'sources')); |
||
34 | $output->writeln('Z executable used: ' . ZBIN); |
||
35 | if (count($sourceFiles)) { |
||
36 | $output->writeln('Loaded source files'); |
||
37 | foreach ($sourceFiles as $file) { |
||
|
|||
38 | $output->writeln(" - " . $file); |
||
39 | } |
||
40 | } else { |
||
41 | $output->writeln('No source files loaded'); |
||
42 | } |
||
43 | $output->writeln('Compiled file: ' . $this->getContainer()->get(array('z', 'cache_file'))); |
||
44 | } |
||
45 | } |
||
46 |
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.