private function getNettePresenterFactory(): Nette\DI\Definitions\ServiceDefinition
    {
        $applicationExtension = $this->compiler->getExtensions(Nette\Bridges\ApplicationDI\ApplicationExtension::class);
        if ($applicationExtension === []) {
            throw new \LogicException('ApplicationExtension not found, did you register it in your configuration?');
        }

        $container = $this->getContainerBuilder();
        $presenterFactory = reset($applicationExtension)->prefix('presenterFactory');
        if (!$container->hasDefinition($presenterFactory)) {
            throw new \LogicException('PresenterFactory service from ApplicationExtension not found. Make sure ApplicationExtension is loaded before PresenterMappingExtension.');
        }

        /** @var Nette\DI\Definitions\ServiceDefinition $serviceDefinition */
        $serviceDefinition = $container->getDefinition($presenterFactory);

        return $serviceDefinition;
    }
private function getNettePresenterFactory(): Nette\DI\Definitions\ServiceDefinition
    {
        $applicationExtension = $this->compiler->getExtensions(Nette\Bridges\ApplicationDI\ApplicationExtension::class);
        if ($applicationExtension === []) {
            throw new \LogicException('ApplicationExtension not found, did you register it in your configuration?');
        }

        $container = $this->getContainerBuilder();
        $presenterFactory = reset($applicationExtension)->prefix('presenterFactory');
        if (!$container->hasDefinition($presenterFactory)) {
            throw new \LogicException('PresenterFactory service from ApplicationExtension not found. Make sure ApplicationExtension is loaded before PresenterMappingExtension.');
        }

        /** @var Nette\DI\Definitions\ServiceDefinition $serviceDefinition */
        $serviceDefinition = $container->getDefinition($presenterFactory);

        return $serviceDefinition;
    }
private function getNettePresenterFactory ( ) : Nette \ DI \ Definitions \ ServiceDefinition { $ applicationExtension = $ this -> compiler -> getExtensions ( Nette \ Bridges \ ApplicationDI \ ApplicationExtension :: class ) ; if ( $ applicationExtension === [ ] ) { throw new \ LogicException ( 'ApplicationExtension not found, did you register it in your configuration?' ) ; } $ container = $ this -> getContainerBuilder ( ) ; $ presenterFactory = reset ( $ applicationExtension ) -> prefix ( 'presenterFactory' ) ; if ( ! $ container -> hasDefinition ( $ presenterFactory ) ) { throw new \ LogicException ( 'PresenterFactory service from ApplicationExtension not found. Make sure ApplicationExtension is loaded before PresenterMappingExtension.' ) ; } /** @var Nette\DI\Definitions\ServiceDefinition $serviceDefinition */ $ serviceDefinition = $ container -> getDefinition ( $ presenterFactory ) ; return $ serviceDefinition ; }
Make sure that ApplicationExtension is loaded before us and return its PresenterFactory definition.

@return Nette\DI\Definitions\ServiceDefinition
Make sure that ApplicationExtension is loaded before us and return its PresenterFactory definition .