protected function getContainer()
    {
        if (!isset($GLOBALS['container'])) {
            $GLOBALS['container'] = new PimpleGate([], $this->getSymfonyContainer());
        }
        $container = $GLOBALS['container'];

        if (!$container instanceof PimpleGate) {
            throw new \RuntimeException(
                'Dependency container is incompatible class. Expected PimpleGate but found ' . get_class($container),
                1
            );
        }

        return $container;
    }