Completed
Pull Request — master (#2)
by Tobias
31:39 queued 01:12
created

AddLoaderToValidationBuilderPass   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 8
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Happyr\AnnotationWarmer\DependencyInjection\CompilerPass;
6
7
use Happyr\AnnotationWarmer\Loader\FakeValidatorLoader;
8
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
9
use Symfony\Component\DependencyInjection\ContainerBuilder;
10
use Symfony\Component\DependencyInjection\Reference;
11
12
/**
13
 * @author Tobias Nyholm <[email protected]>
14
 */
15
final class AddLoaderToValidationBuilderPass implements CompilerPassInterface
16
{
17
    public function process(ContainerBuilder $container)
18
    {
19
        $validatorBuilder = $container->getDefinition('validator.builder');
20
        $validatorBuilder->addMethodCall('addLoader', [new Reference(FakeValidatorLoader::class)]);
21
    }
22
}
23