libs/nomasolutions-api/ApiBundle/ApiBundle.php line 22

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2019 by Noma Solutions.
  4.  * This software is the proprietary information of Noma Solutions.
  5.  *
  6.  * All Right Reserved.
  7.  */
  8. namespace NomaSolutions\ApiBundle;
  9. use NomaSolutions\API\OperationHandler\OperationHandlerInterface;
  10. use NomaSolutions\API\RouteDescriber\SubDescriberInterface;
  11. use NomaSolutions\AuditLog\CustomAuditLoggerInterface;
  12. use NomaSolutions\ApiBundle\DependencyInjection\Compiler\CustomAuditLoggerCompilerPass;
  13. use NomaSolutions\ApiBundle\DependencyInjection\Compiler\OperationHandlerCompilerPass;
  14. use NomaSolutions\ApiBundle\DependencyInjection\Compiler\SubDescriberCompilerPass;
  15. use NomaSolutions\ApiBundle\DependencyInjection\NomaSolutionsApiExtension;
  16. use Symfony\Component\DependencyInjection\ContainerBuilder;
  17. use Symfony\Component\HttpKernel\Bundle\Bundle;
  18. class ApiBundle extends Bundle
  19. {
  20.     public function getContainerExtension()
  21.     {
  22.         return new NomaSolutionsApiExtension();
  23.     }
  24.     public function build(ContainerBuilder $container)
  25.     {
  26.         $container->addCompilerPass(new SubDescriberCompilerPass());
  27.         $container->addCompilerPass(new OperationHandlerCompilerPass());
  28.         $container->addCompilerPass(new CustomAuditLoggerCompilerPass());
  29.         $container->registerForAutoconfiguration(OperationHandlerInterface::class)
  30.             ->addTag('api.operation_handler')
  31.         ;
  32.         $container->registerForAutoconfiguration(SubDescriberInterface::class)
  33.             ->addTag('api.sub_describer')
  34.         ;
  35.         $container->registerForAutoconfiguration(CustomAuditLoggerInterface::class)
  36.             ->addTag('api.custom_audit_logger')
  37.         ;
  38.     }
  39. }