Conditions | 4 |
Paths | 6 |
Total Lines | 18 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
30 | protected function execute(InputInterface $input, OutputInterface $output) |
||
31 | { |
||
32 | /** @var UpdateTablesService $service */ |
||
33 | $service = $this->getContainer()->get(UpdateTablesService::SERVICE_ID); |
||
34 | $response = $service->updateTables(); |
||
35 | |||
36 | if (!is_array($response)) { |
||
37 | $output->writeln($response); |
||
38 | } |
||
39 | |||
40 | $output->writeln('Update successful'); |
||
41 | if (!empty($response)) { |
||
42 | $output->writeln('However these countries were not found and defaulted as France'); |
||
43 | foreach ($response as $countryNotFound) { |
||
|
|||
44 | $output->writeln($countryNotFound); |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 | } |
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.