mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
25 lines
828 B
PHP
25 lines
828 B
PHP
|
<?php
|
||
|
|
||
|
namespace Nelmio\ApiDocBundle\DependencyInjection;
|
||
|
|
||
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
||
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||
|
use Symfony\Component\DependencyInjection\Reference;
|
||
|
|
||
|
class FormInfoParserCompilerPass implements CompilerPassInterface
|
||
|
{
|
||
|
const TAG_NAME = 'nelmio_api_doc.extractor.form_info_parser';
|
||
|
|
||
|
public function process(ContainerBuilder $container)
|
||
|
{
|
||
|
if (!$container->has('nelmio_api_doc.parser.form_type_parser')) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
$formParser = $container->findDefinition('nelmio_api_doc.parser.form_type_parser');
|
||
|
foreach ($container->findTaggedServiceIds(self::TAG_NAME) as $id => $tags) {
|
||
|
$formParser->addMethodCall('addFormInfoParser', [new Reference($id)]);
|
||
|
}
|
||
|
}
|
||
|
}
|