# 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:
    # Active la vérification des CGU.
    app.enableCguChecking: '%env(ENABLE_CGU_CHECKING)%'
    images_directory: '%kernel.project_dir%/public/uploads'

services:
    # 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/Infrastructure/Persistence/Entity/'
            - '../src/Kernel.php'

    Oneup\UploaderBundle\Uploader\Orphanage\OrphanageManager: "@oneup_uploader.orphanage_manager"


    # App\Infrastructure\Security\Subscribers\CguListener:
    #     arguments:
    #         $enableChecking: '%app.enableCguChecking%'

    App\Infrastructure\Security\RegisterUser:
        arguments:
            $fromEmail: '%env(MAILER_SENDER)%'
            $fromName: '%env(MAILER_SENDER_FROM)%'

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones
    tango.visuel_namer_exercice:
        class: App\Infrastructure\Uploader\OneUp\VisuelNamerExercice
        public: true

    tango.visuel_namer_gardien:
        class: App\Infrastructure\Uploader\OneUp\VisuelNamerGardien
        public: true

    tango.visuel_namer_club:
        class: App\Infrastructure\Uploader\OneUp\VisuelNamerClub
        public: true

    tango.upload_listener:
        class: App\Infrastructure\EventListener\VisuelUploadListener
        tags:
            - { name: kernel.event_listener, event: oneup_uploader.post_upload.exercice, method: onPostUploadExercice }
            - { name: kernel.event_listener, event: oneup_uploader.post_upload.gardien, method: onPostUploadGardien }
            - { name: kernel.event_listener, event: oneup_uploader.post_upload.club, method: onPostUploadClub }

    tango.twig.mode:
        class: App\Application\Service\Parametre\ParametreModeService

    tango.twig.ipLocal:
        class: App\Application\Service\Parametre\ParametreIpService
    
    tango.twig.clubs:
        class: App\Application\Service\Planning\ListClubService
    
    tango.twig.club:
        class: App\Application\Service\Club\GetClubService