# config/services.yaml

parameters:
    app.admin_email: 'marc.longmar@gmail.com'
    app.mailAddress: '%env(MAIL_ADDRESS)%'
    pictures_directory: '%kernel.project_dir%/public/uploads/pictures'

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.

    # Charge tous les services automatiquement
    App\:
        resource: '../src/'
        exclude:
            - '../src/DependencyInjection/'
            - '../src/Entity/'
            - '../src/Kernel.php'

    # Configuration spécifique pour EmailService (doit être APRÈS App\:)
    App\Service\EmailService:
        arguments:
            $adminEmail: '%app.admin_email%'

    # Configuration spécifique pour ton extension Twig
    App\Twig\SessionExtension:
        arguments:
            $requestStack: '@request_stack'
        tags: [ 'twig.extension' ]
