PHP Fatal error when getContainer method of ContainerAwareCommand has be...
This commit is contained in:
parent
c505a639b2
commit
8ea5c4c0f6
@ -29,11 +29,17 @@ abstract class ContainerAwareCommand extends Command implements ContainerAwareIn
|
||||
|
||||
/**
|
||||
* @return ContainerInterface
|
||||
* @throws \LogicException
|
||||
*/
|
||||
protected function getContainer()
|
||||
{
|
||||
if (null === $this->container) {
|
||||
$this->container = $this->getApplication()->getKernel()->getContainer();
|
||||
$application = $this->getApplication();
|
||||
if (null === $application) {
|
||||
throw new \LogicException('The container cannot be retrieved as the application instance is not yet set.');
|
||||
}
|
||||
|
||||
$this->container = $application->getKernel()->getContainer();
|
||||
}
|
||||
|
||||
return $this->container;
|
||||
|
Reference in New Issue
Block a user