1 | <?php |
||
15 | abstract class ImportCommandBase extends Command { |
||
16 | |||
17 | /** |
||
18 | * @var ServiceFactory|null |
||
19 | */ |
||
20 | protected $factory = null; |
||
21 | |||
22 | public function setServiceFactory( ServiceFactory $factory ) { |
||
23 | $this->factory = $factory; |
||
24 | } |
||
25 | |||
26 | final protected function execute( InputInterface $input, OutputInterface $output ) { |
||
27 | if ( $this->factory === null ) { |
||
28 | try { |
||
29 | $this->factory = ServiceFactory::newFromConfig(); |
||
|
|||
30 | } |
||
31 | catch ( RuntimeException $ex ) { |
||
32 | $output->writeln( '<error>Could not instantiate the Replicator app</error>' ); |
||
33 | $output->writeln( '<error>' . $ex->getMessage() . '</error>' ); |
||
34 | return; |
||
35 | } |
||
36 | } |
||
37 | |||
38 | $this->executeCommand( $input, $output ); |
||
39 | } |
||
40 | |||
41 | abstract protected function executeCommand( InputInterface $input, OutputInterface $output ); |
||
42 | |||
43 | } |
||
44 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..