# yaml-language-server: $schema=../vendor/symfony/dependency-injection/Loader/schema/services.schema.json

# This file is the entry point to configure your own services.
# Files in the packages/ subdirectory configure your dependencies.
# See also https://symfony.com/doc/current/service_container/import.html

parameters:
    app.admin_email: '%env(ADMIN_EMAIL)%'
    app.url: '%env(APP_URL)%'
    app.mail_from: 'noreply@emilfrey.fr'
    app.mail_from_name: 'App Hub BI'

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.
        bind:
            string $adminEmail: '%app.admin_email%'
            string $appUrl: '%app.url%'
            string $appEnv: '%env(APP_ENV)%'
            string $appSecret: '%env(APP_SECRET)%'
            string $uploadDir: '%kernel.project_dir%/var/uploads'
            string $thumbnailDir: '%kernel.project_dir%/var/thumbnails'
            string $s3AccessKey: '%env(S3_ACCESS_KEY)%'
            string $s3SecretKey: '%env(S3_SECRET_KEY)%'
            string $s3Region: '%env(S3_REGION)%'
            string $s3Bucket: '%env(S3_BUCKET)%'
            string $s3Endpoint: '%env(S3_ENDPOINT)%'
            int $s3Expiry: '%env(int:S3_EXPIRY)%'

    # makes classes in src/ available to be used as services
    App\:
        resource: '../src/'

    App\Service\AppMailer:
        arguments:
            $mailFrom: '%app.mail_from%'
            $mailFromName: '%app.mail_from_name%'
            $appEnv: '%env(APP_ENV)%'
