# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:
    locale: fr_FR
    product_review_images_directory: '%kernel.project_dir%/public/uploads/productReviewImages'
    slider_background_directory: '%kernel.project_dir%/public/uploads/sliderBackground'
    public_slider_background_directory: 'uploads/sliderBackground'
    public_product_review_images_directory: 'uploads/productReviewImages/'

services:
    # 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

    _instanceof:
        Sylius\Bundle\ResourceBundle\Controller\ResourceController:
            autowire: false
        Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType:
            autowire: false

    # Makes classes in src/ available to be used as services;
    # this creates a service per class whose id is the fully-qualified class name
    App\:
        resource: '../src/*'
        exclude: '../src/{Entity,Migrations,Tests,Kernel.php}'

    # 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']

    App\Controller\OrderController:
        autowire: false

    App\Controller\OrderItemController:
        autowire: false

    app.listener.admin.menu_builder:
        class: App\Menu\AdminMenuListener
        tags: 
            - { name: kernel.event_listener, event: sylius.menu.admin.main, method: removeAdminMenuItems}
            - { name: kernel.event_listener, event: sylius.menu.admin.main, method: reorderAdminMenuItems}
    # app.listener.admin.menu_builder:
    #     class: App\Menu\AdminMenuListener
    #     tags:
    #         - { name: kernel.event_listener, event: sylius.menu.admin.main, method: removeAdminMenuItems}
    #         - { name: kernel.event_listener, event: sylius.menu.admin.main, method: reorderAdminMenuItems}

    # app.service.order_fee_manager:
    #     class: App\Service\OrderFeeManager
    #     autowire: true
    #     tags: ['controller.service_arguments']

    # app.form.custom_shipping_method:
    #     class: App\Form\Type\CustomShippingMethodType
    #     tags:
    #         - { name: form.type }
    #     arguments: ['%app.model.custom_shipping_method.class%']
    # app.form.custom_shipping_method_translation:
    #     class: App\Form\Type\CustomShippingMethodTranslationType
    #     tags:
    #         - { name: form.type }
    #     arguments: ['App\Entity\Shipping\CustomShippingMethodTranslation']

    App\Form\Extension\CartItemTypeExtension:
        tags:
            - { name: 'form.type_extension', extended_type: 'Sylius\Bundle\OrderBundle\Form\Type\CartItemType', priority: -1 }

    App\Form\Extension\ProductReviewTypeExtension:
        tags:
            - { name: 'form.type_extension', extended_type: 'Sylius\Bundle\CoreBundle\Form\Type\Product\ProductReviewType', priority: -1 }

    app.service.review_manager:
        class: App\Service\ReviewManager
        autowire: true
        tags: ['controller.service_arguments']

    App\Controller\ProductReviewController:
        autowire: false
        public: true

    app.controller.cgv:
        class: App\Controller\CgvController
        autowire: true
        tags: ['controller.service_arguments']