NelmioApiDocBundle/DependencyInjection/ExtractorHandlerCompilerPass.php

33 lines
952 B
PHP
Raw Normal View History

2013-04-16 13:46:15 +02:00
<?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\Compiler\CompilerPassInterface;
2024-10-01 15:54:04 +03:00
use Symfony\Component\DependencyInjection\ContainerBuilder;
2013-04-16 13:46:15 +02:00
use Symfony\Component\DependencyInjection\Reference;
class ExtractorHandlerCompilerPass implements CompilerPassInterface
{
2024-10-01 15:54:04 +03:00
public function process(ContainerBuilder $container): void
2013-04-16 13:46:15 +02:00
{
2024-10-01 15:54:04 +03:00
$handlers = [];
2013-04-16 13:46:15 +02:00
foreach ($container->findTaggedServiceIds('nelmio_api_doc.extractor.handler') as $id => $attributes) {
$handlers[] = new Reference($id);
}
2013-11-14 10:28:42 +01:00
$container
->getDefinition('nelmio_api_doc.extractor.api_doc_extractor')
2024-10-01 15:54:04 +03:00
->replaceArgument(3, $handlers)
;
2013-04-16 13:46:15 +02:00
}
}