-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathResourceClassResolverPass.php
More file actions
32 lines (27 loc) · 1007 Bytes
/
ResourceClassResolverPass.php
File metadata and controls
32 lines (27 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
* This file is part of the pomm-api-platform-bridge package.
*
*/
namespace PommProject\ApiPlatform\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
/**
* @author Mikael Paris <stood86@gmail.com>
*/
final class ResourceClassResolverPass implements CompilerPassInterface
{
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container)
{
if ($container->hasDefinition('api_platform.resource_class_resolver')) {
$definition = new Definition('PommProject\ApiPlatform\ResourceClassResolver');
$definition->addArgument(new Reference('api_platform.metadata.resource.name_collection_factory'));
$container->setDefinition('api_platform.resource_class_resolver', $definition);
}
}
}