Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
11 | 1 | public function execute(InputInterface $input, OutputInterface $output) |
|
12 | { |
||
13 | 1 | $in = $input->getArgument('command'); |
|
14 | 1 | $text = is_array($in) ? implode(' ', $in) : $in; |
|
15 | 1 | $command = $this->converter->convert($text); |
|
|
|||
16 | 1 | $result = (string) $this->mainframe->execute($command)['output']->get('text'); |
|
17 | 1 | $output->writeln($result); |
|
18 | 1 | } |
|
19 | } |
||
20 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: