<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="twig.class">Twig\Environment</parameter>
        <parameter key="twig.loader.filesystem.class">Symfony\Bundle\TwigBundle\Loader\FilesystemLoader</parameter>
        <parameter key="twig.loader.chain.class">Twig\Loader\ChainLoader</parameter>
        <parameter key="templating.engine.twig.class">Symfony\Bundle\TwigBundle\TwigEngine</parameter>
        <parameter key="twig.cache_warmer.class">Symfony\Bundle\TwigBundle\CacheWarmer\TemplateCacheCacheWarmer</parameter>
        <parameter key="twig.extension.trans.class">Symfony\Bridge\Twig\Extension\TranslationExtension</parameter>
        <parameter key="twig.extension.actions.class">Symfony\Bundle\TwigBundle\Extension\ActionsExtension</parameter>
        <parameter key="twig.extension.code.class">Symfony\Bridge\Twig\Extension\CodeExtension</parameter>
        <parameter key="twig.extension.routing.class">Symfony\Bridge\Twig\Extension\RoutingExtension</parameter>
        <parameter key="twig.extension.yaml.class">Symfony\Bridge\Twig\Extension\YamlExtension</parameter>
        <parameter key="twig.extension.form.class">Symfony\Bridge\Twig\Extension\FormExtension</parameter>
        <parameter key="twig.extension.httpkernel.class">Symfony\Bridge\Twig\Extension\HttpKernelExtension</parameter>
        <parameter key="twig.extension.debug.stopwatch.class">Symfony\Bridge\Twig\Extension\StopwatchExtension</parameter>
        <parameter key="twig.extension.expression.class">Symfony\Bridge\Twig\Extension\ExpressionExtension</parameter>
        <parameter key="twig.form.engine.class">Symfony\Bridge\Twig\Form\TwigRendererEngine</parameter>
        <parameter key="twig.form.renderer.class">Symfony\Bridge\Twig\Form\TwigRenderer</parameter>
        <parameter key="twig.translation.extractor.class">Symfony\Bridge\Twig\Translation\TwigExtractor</parameter>
        <parameter key="twig.exception_listener.class">Symfony\Component\HttpKernel\EventListener\ExceptionListener</parameter>
        <parameter key="twig.controller.exception.class">Symfony\Bundle\TwigBundle\Controller\ExceptionController</parameter>
        <parameter key="twig.controller.preview_error.class">Symfony\Bundle\TwigBundle\Controller\PreviewErrorController</parameter>
    </parameters>

    <services>
        <service id="twig" class="%twig.class%">
            <argument type="service" id="twig.loader" />
            <argument /> <!-- Twig options -->
            <call method="addGlobal">
                <argument>app</argument>
                <argument type="service" id="twig.app_variable" />
            </call>
            <configurator service="twig.configurator.environment" method="configure" />
        </service>

        <service id="twig.app_variable" class="Symfony\Bridge\Twig\AppVariable" public="false">
            <call method="setEnvironment"><argument>%kernel.environment%</argument></call>
            <call method="setDebug"><argument>%kernel.debug%</argument></call>
            <call method="setTokenStorage"><argument type="service" id="security.token_storage" on-invalid="ignore" /></call>
            <call method="setRequestStack"><argument type="service" id="request_stack" on-invalid="ignore" /></call>
        </service>

        <service id="twig.cache_warmer" class="%twig.cache_warmer.class%" public="false">
            <tag name="kernel.cache_warmer" />
            <argument type="service" id="service_container" />
            <argument type="service" id="templating.finder" on-invalid="ignore" />
        </service>

        <service id="twig.loader.native_filesystem" class="Twig\Loader\FilesystemLoader" public="false">
            <argument type="collection" />
            <tag name="twig.loader"/>
        </service>

        <service id="twig.loader.chain" class="%twig.loader.chain.class%" public="false"/>

        <service id="twig.extension.profiler" class="Symfony\Bridge\Twig\Extension\ProfilerExtension" public="false">
            <argument type="service" id="twig.profile" />
            <argument type="service" id="debug.stopwatch" on-invalid="null" />
        </service>

        <service id="twig.profile" class="Twig\Profiler\Profile" />

        <service id="data_collector.twig" class="Symfony\Bridge\Twig\DataCollector\TwigDataCollector" public="false">
            <tag name="data_collector" template="@WebProfiler/Collector/twig.html.twig" id="twig" priority="255" />
            <argument type="service" id="twig.profile" />
        </service>

        <service id="twig.extension.trans" class="%twig.extension.trans.class%" public="false">
            <argument type="service" id="translator" />
        </service>

        <service id="twig.extension.assets" class="Symfony\Bridge\Twig\Extension\AssetExtension" public="false">
            <argument type="service" id="assets.packages" />
            <argument type="service" id="twig.extension.httpfoundation" />
        </service>

        <service id="twig.extension.actions" class="%twig.extension.actions.class%" public="false">
            <argument type="service" id="fragment.handler" />
        </service>

        <service id="twig.extension.code" class="%twig.extension.code.class%" public="false">
            <tag name="twig.extension" />
            <argument /> <!-- %templating.helper.code.file_link_format% -->
            <argument>%kernel.root_dir%</argument>
            <argument>%kernel.charset%</argument>
        </service>

        <service id="twig.extension.routing" class="%twig.extension.routing.class%" public="false">
            <argument type="service" id="router" />
        </service>

        <service id="twig.extension.yaml" class="%twig.extension.yaml.class%" public="false">
            <tag name="twig.extension" />
        </service>

        <service id="twig.extension.debug.stopwatch" class="%twig.extension.debug.stopwatch.class%" public="false">
            <tag name="twig.extension" />
            <argument type="service" id="debug.stopwatch" on-invalid="ignore" />
            <argument>%kernel.debug%</argument>
        </service>

        <service id="twig.extension.expression" class="%twig.extension.expression.class%" public="false">
            <tag name="twig.extension" />
        </service>

        <service id="twig.extension.httpkernel" class="%twig.extension.httpkernel.class%" public="false">
            <argument type="service" id="fragment.handler" />
        </service>

        <service id="twig.extension.httpfoundation" class="Symfony\Bridge\Twig\Extension\HttpFoundationExtension" public="false">
            <argument type="service" id="request_stack" />
            <argument type="service" id="router.request_context" on-invalid="ignore" />
        </service>

        <service id="twig.extension.debug" class="Twig\Extension\DebugExtension" public="false" />

        <service id="twig.translation.extractor" class="%twig.translation.extractor.class%">
            <argument type="service" id="twig" />
            <tag name="translation.extractor" alias="twig" />
        </service>

        <service id="twig.exception_listener" class="%twig.exception_listener.class%">
            <tag name="kernel.event_subscriber" />
            <tag name="monolog.logger" channel="request" />
            <argument>%twig.exception_listener.controller%</argument>
            <argument type="service" id="logger" on-invalid="null" />
            <argument>%kernel.debug%</argument>
        </service>

        <service id="twig.controller.exception" class="%twig.controller.exception.class%">
            <argument type="service" id="twig" />
            <argument>%kernel.debug%</argument>
        </service>

        <service id="twig.controller.preview_error" class="%twig.controller.preview_error.class%">
            <argument type="service" id="http_kernel" />
            <argument>%twig.exception_listener.controller%</argument>
        </service>

        <service id="twig.configurator.environment" class="Symfony\Bundle\TwigBundle\DependencyInjection\Configurator\EnvironmentConfigurator" public="false">
            <argument /> <!-- date format, set in TwigExtension -->
            <argument /> <!-- interval format, set in TwigExtension -->
            <argument /> <!-- timezone, set in TwigExtension -->
            <argument /> <!-- decimals, set in TwigExtension -->
            <argument /> <!-- decimal point, set in TwigExtension -->
            <argument /> <!-- thousands separator, set in TwigExtension -->
        </service>
    </services>
</container>
