parameters:
    env(INDEX_ROBOT): 'true'
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,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\Twig\AppExtension:
        arguments:
            $indexRobot: '%env(INDEX_ROBOT)%'
        tags:
            - { name: twig.extension }

    
    App\Command\CreateProductOptionsCommandPhoto:
        arguments:
            $optionRepository: '@sylius.repository.product_option'
            $valueRepository: '@sylius.repository.product_option_value'
            $optionFactory: '@sylius.factory.product_option'
            $optionValueFactory: '@sylius.factory.product_option_value'
    
    App\Command\GeneratePhotoVariantsCommand:
        arguments:
            $productRepository: '@sylius.repository.product'
            $channelRepository: '@sylius.repository.channel'
            $variantFactory: '@sylius.factory.product_variant'
            $channelPricingFactory: '@sylius.factory.channel_pricing'

    App\EventSubscriber\ProductCreationSubscriber:
        tags: [ 'doctrine.orm.entity_listener' ]
        arguments:
            $variantFactory: '@sylius.factory.product_variant'
            $channelPricingFactory: '@sylius.factory.channel_pricing'
            $channelRepository: '@sylius.repository.channel'