# 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/configuration.html#application-related-configuration
parameters:
    excelTempDir: '../src/Resources/'
    logoDirectory: '%kernel.project_dir%/assets/images/'
    excel_templates_path: '%kernel.project_dir%/excel_templates/'
    temp_folder: '%kernel.project_dir%/var/temp/daily_reports/'
    mail_from: '%env(MAIL_FROM_ADDRESS)%'
    profile_pics_dir: '%kernel.project_dir%/public/uploads/profile-pics/'
    blog_images_dir: '%kernel.project_dir%/public/uploads/blog-images/'
    cms_images_dir: '%kernel.project_dir%/public/uploads/cms-images/'
    widgets_images_dir: '%kernel.project_dir%/public/uploads/widget-images/'
    company_logos_dir: '%kernel.project_dir%/public/uploads/company-logos/'
    system_admin_email: '%env(resolve:SYSTEM_ADMIN_EMAIL)%'
    contact_mail_address: 'lebogang.ratsoana@yahoo.com'
    google_recaptcha_site_key: '%env(GOOGLE_RECAPTCHA_SITE_KEY)%'
    imports_dir: '%kernel.project_dir%%env(imports_dir)%'

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.
        public: true
        bind:
            $projectDirectory: '%kernel.project_dir%'
            $systemMailFrom: '%mail_from%'
            $logoDirectory: '%logoDirectory%'

    # 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'
            - '../src/Tests/'
            - '../src/Dashboards/'
            - '../src/Import/'

    # controllers are imported separately to make sure services can be injected
    # as action arguments even if you don't extend any base controller class
    App\Controller\:
        resource: '../src/Controller/'
        tags: ['controller.service_arguments']

    # add more service definitions when explicit configuration is needed
    # please note that last definitions always *replace* previous ones

    # add in Twig extension from UI
    ASG\Bundle\WyreframeInterfaceBundle\Twig\Extension\BundleExtension: ~

    App\Service\PasswordResetter:
        class: App\Service\PasswordResetter
        arguments:
            - '@App\Repository\ForgotPasswordRepository'
            - '@doctrine.orm.entity_manager'

    App\Service\AccountActionEmailSender:
        class: App\Service\AccountActionEmailSender
        arguments:
            - '@mailer.mailer'

    App\Twig\ApplicationMenuExtension:
        arguments: [ '@Symfony\Component\Security\Core\Security', '@Symfony\Component\HttpFoundation\RequestStack' , '%kernel.project_dir%' ]
        tags: [ twig.extension ]

    App\Twig\CustomFiltersExtension:
        arguments:
            - '@Symfony\Component\Routing\RouterInterface'
            - '%kernel.project_dir%'

    ReCaptcha\ReCaptcha:
        arguments:
            - '%env(GOOGLE_RECAPTCHA_SECRET_KEY)%'

    App\Service\FormHandler:
        class: App\Service\FormHandler
        arguments:
            - '@doctrine.orm.entity_manager'

    App\Command\ImportSurveyCommand:
        arguments:
            - '@doctrine.orm.entity_manager'
            - '@Lebo\ImportBundle\Repository\ImportRepository'
            - '%kernel.project_dir%%env(imports_dir)%'

    Lebo\ImportBundle\Form\ImportType:
        arguments:
            - '@Symfony\Component\Security\Core\Security'
            - '@doctrine.orm.entity_manager'

    App\Service\MailerTransportFactory:
        tags:
            - { name: mailer.transport_factory }