1 | <?php |
||
40 | 1 | class ClientCommand extends Console\Command\Command |
|
41 | { |
||
42 | /** |
||
43 | * @var Client\IClient |
||
44 | */ |
||
45 | private $client; |
||
46 | |||
47 | /** |
||
48 | * @var Log\LoggerInterface|Log\NullLogger|NULL |
||
49 | */ |
||
50 | private $logger; |
||
51 | |||
52 | /** |
||
53 | * @var bool |
||
54 | */ |
||
55 | private $isRunning = FALSE; |
||
56 | |||
57 | /** |
||
58 | * @param Client\IClient $client |
||
59 | * @param Log\LoggerInterface|NULL $logger |
||
60 | * @param string|NULL $name |
||
61 | */ |
||
62 | public function __construct( |
||
72 | |||
73 | /** |
||
74 | * @param Log\LoggerInterface $logger |
||
75 | * |
||
76 | * @return void |
||
77 | * |
||
78 | * @throws Exceptions\InvalidStateException |
||
79 | */ |
||
80 | public function setLogger(Log\LoggerInterface $logger) : void |
||
88 | |||
89 | /** |
||
90 | * @return void |
||
91 | */ |
||
92 | protected function configure() |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | protected function execute(Input\InputInterface $input, Output\OutputInterface $output) |
||
128 | } |
||
129 |
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: