src/DependencyInjection/Compiler/GeneratePageflowDefinitionsPass.php
public function process(ContainerBuilder $container)
    {
        foreach ($container->findTaggedServiceIds('phpmentors_pageflower.pageflow') as $controllerServiceId => $attribute) {
            $controllerClass = new \ReflectionClass($container->getParameterBag()->resolveValue($container->getDefinition($controllerServiceId)->getClass()));
            if (!$controllerClass->implementsInterface('PHPMentors\PageflowerBundle\Controller\ConversationalControllerInterface')) {
                throw new \LogicException(sprintf(
                    'The controller "%s" must implement "%s".',
                    $controllerClass->getName(),
                    'PHPMentors\PageflowerBundle\Controller\ConversationalControllerInterface'
                ));
            }

            $pages = array();
            $pageflowDefinitionGenerator = new PageflowDefinitionGenerator($container, $controllerClass, $controllerServiceId, $container->get('annotation_reader'), $pages);
            $pageflowDefinitionGenerator->generate();

            $reflectionConversationalControllerDefinitionGenerator = new ReflectionConversationalControllerDefinitionGenerator($container, $controllerClass, $controllerServiceId, $container->get('annotation_reader'), $pages);
            $reflectionConversationalControllerDefinitionGenerator->generate();
        }
    }
public function process(ContainerBuilder $container)
    {
        foreach ($container->findTaggedServiceIds('phpmentors_pageflower.pageflow') as $controllerServiceId => $attribute) {
            $controllerClass = new \ReflectionClass($container->getParameterBag()->resolveValue($container->getDefinition($controllerServiceId)->getClass()));
            if (!$controllerClass->implementsInterface('PHPMentors\PageflowerBundle\Controller\ConversationalControllerInterface')) {
                throw new \LogicException(sprintf(
                    'The controller "%s" must implement "%s".',
                    $controllerClass->getName(),
                    'PHPMentors\PageflowerBundle\Controller\ConversationalControllerInterface'
                ));
            }

            $pages = array();
            $pageflowDefinitionGenerator = new PageflowDefinitionGenerator($container, $controllerClass, $controllerServiceId, $container->get('annotation_reader'), $pages);
            $pageflowDefinitionGenerator->generate();

            $reflectionConversationalControllerDefinitionGenerator = new ReflectionConversationalControllerDefinitionGenerator($container, $controllerClass, $controllerServiceId, $container->get('annotation_reader'), $pages);
            $reflectionConversationalControllerDefinitionGenerator->generate();
        }
    }
{@inheritdoc}