# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.

# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices.html#use-parameters-for-application-configuration
parameters:

services:
    App\Services\PdfGeneratorService: ~
    App\Services\EmailService:
        arguments:
            $mailer: '@mailer.mailer'
            $pdfGeneratorService: '@App\Services\PdfGeneratorService'

    App\EventListener\UserPostWriteListener:
        tags:
            - { name: 'kernel.event_subscriber' }
    App\EventSubscriber\ProductPriceSubscriber:
        tags:
            - { name: 'kernel.event_subscriber' }
            
    # App\EventSubscriber\UserSubscriber:
    #     arguments:
    #         $passwordHasher: '@security.password_hasher'
    #     tags:
    #         - { name: 'kernel.event_subscriber' }
    App\EventSubscriber\OrderSubscriber:
        arguments:
            $emailService: '@App\Services\EmailService'
            $entityManager: '@doctrine.orm.entity_manager'
        tags:
            - { name: 'kernel.event_subscriber' }
    # default configuration for services in *this* file
    _defaults:
        autowire: true      # Automatically injects dependencies in your services.
        autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.

    # 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/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'
    App\EventSubscriber\EasyAdminSubscriber:
        tags:
            - { name: 'kernel.event_subscriber' }
    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones

    # App\Services\OrderService:
    #     arguments:
    #         $entityManager: '@doctrine.orm.entity_manager'
    
    # App\Services\UserService:
    #     arguments:
    #         $entityManager: '@doctrine.orm.entity_manager'
    #         $passwordHasher: '@security.password_hasher'
 
    App\Services\ResetPasswordService:
        arguments:
            $mailer: '@mailer.mailer'
            $router: '@router'
            $tokenGenerator: '@security.csrf.token_generator'
            $entityManager: '@doctrine.orm.entity_manager'

    App\Filter\CategoryFilter:
        arguments:
            $categoryRepository: '@App\Repository\CategoryRepository'
            
    # App\EventSubscriber\PasswordEncoderSubscriber:
    #     tags:
    #         - { name: 'kernel.event_subscriber' }