imports:
    - { resource: "sylius/resources.yaml" }

parameters:
    database_driver: pdo_sqlite
    database_path: "%kernel.project_dir%/config/db.sql"

    locale: en_US
    secret: "Three can keep a secret, if two of them are dead."

services:
    # Gets rid of "[error] Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException"
    # errors in PHPUnit output when testing 404 errors.
    Psr\Log\NullLogger: ~
    logger: '@Psr\Log\NullLogger'

    # Default configuration for services in *this* file
    _defaults:
        # Automatically injects dependencies in your services
        autowire: true

        # Automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true

        # Allows optimizing the container by removing unused services; this also means
        # fetching services directly from the container via $container->get() won't work
        public: false

    # Controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller'
        tags: ['controller.service_arguments']

    test.translation_locale_provider:
        class: Sylius\Component\Resource\Translation\Provider\ImmutableTranslationLocaleProvider
        arguments:
            - ["pl_PL", "en_US", "de_DE"]
            - "en_US"

    test.custom_book_factory:
        class: App\Factory\CustomBookFactory
        public: true
        arguments:
            - "%app.model.book.class%"
            - "@test.translation_locale_provider"

    test.custom_book_repository:
        class: App\Repository\CustomBookRepository
        public: true
        arguments:
            - "@app.repository.book"

    app.form.type.book:
        class: App\Form\Type\BookType
        arguments:
            - '%app.model.book.class%'
        tags: ['form.type']

    app.form.type.book_translation:
        class: App\Form\Type\BookTranslationType
        arguments:
            - '%app.model.book_translation.class%'
        tags: ['form.type']

    Gedmo\Sortable\SortableListener:
        calls:
            -
                setAnnotationReader: ['@annotation_reader']
        tags:
            -
                name: doctrine.event_subscriber
                connection: default
