1 | <?php /** MicroConsole */ |
||
20 | class Console |
||
21 | { |
||
22 | /** @var IContainer $container */ |
||
23 | protected $container; |
||
24 | /** @var string $command Parsed command */ |
||
25 | protected $command; |
||
26 | /** @var array $args Arguments from params */ |
||
27 | protected $args = []; |
||
28 | |||
29 | /** |
||
30 | * Constructor command |
||
31 | * |
||
32 | * @access public |
||
33 | * |
||
34 | * @param IContainer $container |
||
35 | * |
||
36 | * @result void |
||
37 | */ |
||
38 | public function __construct(IContainer $container) |
||
48 | |||
49 | /** |
||
50 | * Run action of console command by name |
||
51 | * |
||
52 | * @access public |
||
53 | * |
||
54 | * @param string $name Command name |
||
55 | * |
||
56 | * @return bool|ConsoleCommand|string |
||
57 | */ |
||
58 | public function action($name) |
||
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: