<?php
/**
* Copyright (c) 2019 by Noma Solutions.
* This software is the proprietary information of Noma Solutions.
*
* All Right Reserved.
*/
namespace NomaSolutions\ApiBundle;
use NomaSolutions\API\OperationHandler\OperationHandlerInterface;
use NomaSolutions\API\RouteDescriber\SubDescriberInterface;
use NomaSolutions\AuditLog\CustomAuditLoggerInterface;
use NomaSolutions\ApiBundle\DependencyInjection\Compiler\CustomAuditLoggerCompilerPass;
use NomaSolutions\ApiBundle\DependencyInjection\Compiler\OperationHandlerCompilerPass;
use NomaSolutions\ApiBundle\DependencyInjection\Compiler\SubDescriberCompilerPass;
use NomaSolutions\ApiBundle\DependencyInjection\NomaSolutionsApiExtension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ApiBundle extends Bundle
{
public function getContainerExtension()
{
return new NomaSolutionsApiExtension();
}
public function build(ContainerBuilder $container)
{
$container->addCompilerPass(new SubDescriberCompilerPass());
$container->addCompilerPass(new OperationHandlerCompilerPass());
$container->addCompilerPass(new CustomAuditLoggerCompilerPass());
$container->registerForAutoconfiguration(OperationHandlerInterface::class)
->addTag('api.operation_handler')
;
$container->registerForAutoconfiguration(SubDescriberInterface::class)
->addTag('api.sub_describer')
;
$container->registerForAutoconfiguration(CustomAuditLoggerInterface::class)
->addTag('api.custom_audit_logger')
;
}
}