mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
|
<?php
|
||
|
|
||
|
/*
|
||
|
* This file is part of the NelmioApiDocBundle.
|
||
|
*
|
||
|
* (c) Nelmio <hello@nelm.io>
|
||
|
*
|
||
|
* For the full copyright and license information, please view the LICENSE
|
||
|
* file that was distributed with this source code.
|
||
|
*/
|
||
|
|
||
|
namespace Nelmio\ApiDocBundle\DependencyInjection;
|
||
|
|
||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||
|
use Symfony\Component\DependencyInjection\Reference;
|
||
|
|
||
|
|
||
|
class ExtractorHandlerCompilerPass implements CompilerPassInterface
|
||
|
{
|
||
|
/**
|
||
|
* {@inheritDoc}
|
||
|
*/
|
||
|
public function process(ContainerBuilder $container)
|
||
|
{
|
||
|
$handlers = array();
|
||
|
foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.handler') as $id => $attributes) {
|
||
|
|
||
|
// Adding handlers from tagged services
|
||
|
$handlers[] = new Reference($id);
|
||
|
}
|
||
|
$definition = $container->getDefinition(
|
||
|
'nelmio_api_doc.extractor.api_doc_extractor'
|
||
|
);
|
||
|
$definition->replaceArgument(4, $handlers);
|
||
|
}
|
||
|
}
|