parameters:
    archiveMediaDir: '%kernel.project_dir%/../hesabixArchive'
    archiveTempMediaDir: '%kernel.project_dir%/../hesabixArchive/temp'
    avatarDir: '%kernel.project_dir%/../hesabixArchive/avatars'
    sealDir: '%kernel.project_dir%/../hesabixArchive/seal'
    SupportFilesDir: '%kernel.project_dir%/../hesabixArchive/support'

services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: false

    App\Command\UpdateSoftwareCommand:
        arguments:
            $logger: '@Psr\Log\LoggerInterface'
            $lockFactory: '@Symfony\Component\Lock\LockFactory'
        tags:
          - { name: 'console.command' }

    App\Command\ReleaseUpdateLockCommand:
        arguments:
            $lockFactory: '@Symfony\Component\Lock\LockFactory'
        tags:
          - { name: 'console.command' }

    Symfony\Component\Lock\LockFactory:
        arguments:
            $store: '@lock.store.flock'

    lock.store.flock:
        class: Symfony\Component\Lock\Store\FlockStore
        arguments:
          - '%kernel.project_dir%/var/lock'

    App\:
        resource: '../src/'
        exclude:
          - '../src/DependencyInjection/'
          - '../src/Entity/'
          - '../src/Kernel.php'

    doctrine.orm.default_attribute_driver:
        class: Doctrine\ORM\Mapping\Driver\AttributeDriver
        arguments:
          - [ '%kernel.project_dir%/src/Entity' ]
          - true # تنظیم reportFieldsWhereDeclared روی true برای رفع Deprecation
        tags:
          - { name: doctrine.orm.mapping_driver }

    App\EventListener\DoctrineExceptionListener:
        arguments:
            $kernel: '@kernel'
            $logger: '@logger'
            $lockFactory: '@lock.default.factory'
            $entityManager: '@doctrine.orm.default_entity_manager'
        tags:
          - { name: kernel.event_listener, event: kernel.exception }

    App\Security\AuthenticationFailureHandler:
        arguments:
            $captchaService: '@App\Service\CaptchaService'
            $requestStack: '@request_stack'

    Jdate:
        class: App\Service\Jdate

    Exctractor:
        class: App\Service\Exctractor

    Log:
        class: App\Service\Log
        arguments: [ '@doctrine.orm.entity_manager' ]

    SMS:
        class: App\Service\SMS
        arguments:
            $entityManager: '@doctrine.orm.entity_manager'

    Provider:
        class: App\Service\Provider
        arguments: [ '@doctrine.orm.entity_manager' ]

    twigFunctions:
        class: App\Service\twigFunctions
        arguments: [ '@doctrine.orm.entity_manager', '@request_stack', '@registryMGR' ]

    registryMGR:
        class: App\Service\registryMGR
        arguments: [ '@doctrine.orm.entity_manager' ]

    Printers:
        class: App\Service\Printers
        arguments: [ '@doctrine.orm.entity_manager' ]

    App\Twig\NumberFormatExtension:
        tags: ['twig.extension']

    App\Cog\PersonService:
        arguments:
            $entityManager: '@doctrine.orm.entity_manager'
            $access: '@App\Service\Access'
