services:
    _defaults:
        autowire: true
        autoconfigure: true
        public: true
        bind:
          $fontwesomeStyle: '%fontawesome_style%'
          $siteUrl: '%env(string:SITE_URL)%'
          $configurations: '%tigris_base%'
          $imageStyles: '%tigris_base.image_styles%'
          $wordingConfig: '%tigris_base.wording%'
    
    Tigris\BaseBundle\Doctrine\TablePrefix:
        arguments: 
            $prefix: '%env(string:DATABASE_PREFIX)%'

    Tigris\BaseBundle\Factory\PhpSpreadsheetFactory: ~

    Tigris\BaseBundle\Menu\MenuBuilder:
        tags:
            - { name: knp_menu.menu_builder, method: createMainMenu, alias: main }
            - { name: knp_menu.menu_builder, method: createAdminMenu, alias: admin }
            - { name: knp_menu.menu_builder, method: createUserMenu, alias: user }
            - { name: knp_menu.menu_builder, method: myAccountMenu, alias: myaccount }
            - { name: knp_menu.menu_builder, method: userProfileMenu, alias: userprofile }

    #Twig extension
    Tigris\BaseBundle\Twig\:
      resource: '../src/Twig/*'
      tags:
        - {name: twig.extension}

    #Form extension
    Tigris\BaseBundle\Form\Extension\:
        resource: '../src/Form/Extension/*'
        tags:
            - { name: form.type_extension }

    Tigris\BaseBundle\Service\:
        resource: '../src/Service/*'
        exclude: 
          - '../src/Service/Google/Review.php'
          - '../src/Service/Meta/GraphAPI/FacebookAPIField.php'

    # Voters
    Tigris\BaseBundle\Security\Voter\:
        resource: '../src/Security/Voter/*'
        tags: [security.voter]

    Tigris\BaseBundle\Security\UserChecker:
        public: true
        autowire: true

    Tigris\BaseBundle\Repository\:
        resource: '../src/Repository/*'

    Tigris\BaseBundle\Repository\UserRepository:
        arguments:
            $userClass: '%user_class%'

    Tigris\BaseBundle\Form\Type\:
        resource: '../src/Form/Type'
        tags:
            - { name: form.type }

    Tigris\BaseBundle\Form\Transformer\UploadFileViewTransformer: ~
  
    Tigris\BaseBundle\Form\Transformer\UploadFileModelTransformer: ~

    Tigris\BaseBundle\Security\LoginFormAuthenticator: ~
    Tigris\BaseBundle\Security\ShibbolethAuthenticator:
        arguments:
            $config: '%tigris_base.shibboleth%'

    Tigris\BaseBundle\Controller\:
        resource: '../src/Controller/'

    Tigris\BaseBundle\EventListener\:
        resource: '../src/EventListener/*'

    Tigris\BaseBundle\EventSubscriber\:
        resource: '../src/EventSubscriber/*'
          
    Tigris\BaseBundle\Manager\:
        resource: '../src/Manager/*'

    Tigris\BaseBundle\Manager\UserManager:
        arguments:
            $userClass: '%user_class%'

    Tigris\BaseBundle\Command\:
      resource: '../src/Command/*'
      tags: ['console.command']

    Tigris\BaseBundle\Service\Geocoding\AddressGouv: ~

    Tigris\BaseBundle\Contracts\Geocoding\GeocodingInterface: '@Tigris\BaseBundle\Service\Geocoding\AddressGouv'

    Tigris\BaseBundle\Notification\Notification: ~

    Tigris\BaseBundle\Validator\:
      resource: '../src/Validator/*'
      tags:
        - { name: validator.constraint_validator }

    Tigris\BaseBundle\Service\Meta\FacebookPixel:
        arguments:
            $configs: '%tigris_base.facebook%'

    Tigris\BaseBundle\Service\Meta\GraphAPI\FacebookGraphAPI:
    Tigris\BaseBundle\Service\Meta\GraphAPI\InstagramGraphAPI:

    Tigris\BaseBundle\Mailing\:
        resource: '../src/Mailing/*'

imports:
    - { resource: readers.yaml }
    - { resource: data_importer.yaml }
    - { resource: writers.yaml }
    - { resource: data_exporter.yaml }

when@dev:
  services:
    Tigris\BaseBundle\DataFixtures\:
      autowire: true
      resource: '../src/DataFixtures/*'
      tags: [doctrine.fixture.orm]

when@test:
  services:
    Tigris\BaseBundle\DataFixtures\:
      autowire: true
      resource: '../src/DataFixtures/*'
      tags: [doctrine.fixture.orm]