final protected function getLegacyKernel()
    {
        if (!isset($this->legacyKernelClosure)) {
            $this->legacyKernelClosure = $this->get('ezpublish_legacy.kernel');
        }

        $legacyKernelClosure = $this->legacyKernelClosure;

        return $legacyKernelClosure();
    }