mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 07:41:43 +03:00
25 lines
841 B
PHP
25 lines
841 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
|
|
{
|
|
public const TAG_NAME = 'nelmio_api_doc.extractor.form_info_parser';
|
|
|
|
public function process(ContainerBuilder $container): void
|
|
{
|
|
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)]);
|
|
}
|
|
}
|
|
}
|