2020-07-02 22:57:05 +03:00
|
|
|
<?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
|
|
|
|
{
|
2024-10-01 15:54:04 +03:00
|
|
|
public const TAG_NAME = 'nelmio_api_doc.extractor.form_info_parser';
|
2020-07-02 22:57:05 +03:00
|
|
|
|
2024-10-01 15:54:04 +03:00
|
|
|
public function process(ContainerBuilder $container): void
|
2020-07-02 22:57:05 +03:00
|
|
|
{
|
|
|
|
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)]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|