2016-07-12 00:33:55 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/*
|
2016-12-29 12:09:26 +01:00
|
|
|
* This file is part of the NelmioApiDocBundle package.
|
2016-07-12 00:33:55 +02:00
|
|
|
*
|
2016-12-29 12:09:26 +01:00
|
|
|
* (c) Nelmio
|
2016-07-12 00:33:55 +02:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2016-12-29 12:09:26 +01:00
|
|
|
namespace Nelmio\ApiDocBundle\DependencyInjection\Compiler;
|
2016-07-12 00:33:55 +02:00
|
|
|
|
2016-07-15 00:04:07 +02:00
|
|
|
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
|
2016-07-12 00:33:55 +02:00
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
|
|
|
2016-07-15 00:40:30 +02:00
|
|
|
class AddRouteDescribersPass implements CompilerPassInterface
|
2016-07-12 00:33:55 +02:00
|
|
|
{
|
|
|
|
use PriorityTaggedServiceTrait;
|
|
|
|
|
|
|
|
public function process(ContainerBuilder $container)
|
|
|
|
{
|
2016-12-29 12:09:26 +01:00
|
|
|
$routeDescribers = $this->findAndSortTaggedServices('nelmio_api_doc.route_describer', $container);
|
2016-07-12 00:33:55 +02:00
|
|
|
|
2016-12-30 13:37:02 +01:00
|
|
|
$container->getDefinition('nelmio_api_doc.describers.route')->replaceArgument(2, $routeDescribers);
|
2016-07-12 00:33:55 +02:00
|
|
|
}
|
|
|
|
}
|