Conditions | 3 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php /** MicroConsole */ |
||
58 | public function action($name) |
||
59 | { |
||
60 | $command = '\\Micro\\Cli\\Consoles\\' . $name . 'ConsoleCommand'; |
||
61 | $command = class_exists($command) ? $command : '\\App\\Consoles\\' . $name . 'ConsoleCommand'; |
||
62 | |||
63 | if (!class_exists($command)) { |
||
64 | return false; |
||
65 | } |
||
66 | |||
67 | /** @var ConsoleCommand $command */ |
||
68 | $command = new $command (['container' => $this->container, 'args' => $this->args]); |
||
69 | $command->execute(); |
||
70 | |||
71 | return $command; |
||
72 | } |
||
73 | } |
||
74 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: