<?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">

    <services>
        <service id="Shopware\Core\System\Snippet\Aggregate\SnippetSet\SnippetSetDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\Snippet\SnippetDefinition">
            <tag name="shopware.entity.definition"/>
        </service>

        <service id="Shopware\Core\System\Snippet\SnippetValidatorInterface" class="Shopware\Core\System\Snippet\SnippetValidator">
            <argument type="service" id="Shopware\Core\System\Snippet\Files\SnippetFileCollection" />
            <argument type="service" id="Shopware\Core\System\Snippet\SnippetFileHandler" />
            <argument>%kernel.project_dir%/</argument>
        </service>

        <service id="Shopware\Core\System\Snippet\SnippetValidator">
            <argument type="service" id="Shopware\Core\System\Snippet\Files\SnippetFileCollection" />
            <argument type="service" id="Shopware\Core\System\Snippet\SnippetFileHandler" />
            <argument>%kernel.project_dir%/</argument>
        </service>

        <service id="Shopware\Core\System\Snippet\SnippetFixer">
            <argument type="service" id="Shopware\Core\System\Snippet\SnippetFileHandler" />
        </service>

        <service id="Shopware\Core\System\Snippet\Command\ValidateSnippetsCommand">
            <argument type="service" id="Shopware\Core\System\Snippet\SnippetValidator" />
            <argument type="service" id="Shopware\Core\System\Snippet\SnippetFixer" />

            <tag name="console.command"/>
        </service>

        <service id="Shopware\Core\System\Snippet\Command\InstallTranslationCommand">
            <argument type="service" id="Shopware\Core\System\Snippet\Service\TranslationLoader"/>
            <argument type="service" id="Shopware\Core\System\Snippet\Struct\TranslationConfig"/>

            <tag name="console.command"/>
        </service>

        <service id="shopware.translation.client" class="GuzzleHttp\Client"/>

        <service id="Shopware\Core\System\Snippet\Service\TranslationConfigLoader">
            <argument type="service" id="filesystem"/>
        </service>

        <service id="Shopware\Core\System\Snippet\Struct\TranslationConfig" lazy="true" public="true">
            <factory service="Shopware\Core\System\Snippet\Service\TranslationConfigLoader" method="load"/>
        </service>

        <service id="Shopware\Core\System\Snippet\Service\TranslationLoader">
            <argument type="service" id="shopware.filesystem.private"/>
            <argument type="service" id="language.repository"/>
            <argument type="service" id="locale.repository"/>
            <argument type="service" id="snippet_set.repository"/>
            <argument type="service" id="shopware.translation.client"/>
            <argument type="service" id="Shopware\Core\System\Snippet\Struct\TranslationConfig"/>
            <argument type="service" id="validator"/>
        </service>

        <service id="Shopware\Core\System\Snippet\SnippetFileHandler">
            <argument type="service" id="filesystem"/>
        </service>

        <service id="Shopware\Core\System\Snippet\Subscriber\CustomFieldSubscriber">
            <argument type="service" id="Doctrine\DBAL\Connection"/>
            <tag name="kernel.event_subscriber"/>
        </service>
    </services>
</container>
