GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( d399db...857eb8 )
by Steevan
02:14
created

AddReadOnlyHydrationModePass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 8 2
1
<?php
2
3
namespace steevanb\DoctrineReadOnlyHydrator\Bridge\Symfony3\DependencyInjection\Compiler;
4
5
use steevanb\DoctrineReadOnlyHydrator\Hydrator\ReadOnlyHydrator;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
9
class AddReadOnlyHydrationModePass implements CompilerPassInterface
10
{
11
    /**
12
     * @param ContainerBuilder $container
13
     */
14
    public function process(ContainerBuilder $container)
15
    {
16
        $hydrator = [ReadOnlyHydrator::HYDRATOR_NAME, ReadOnlyHydrator::class];
17
        foreach ($container->getParameter('doctrine.entity_managers') as $name => $serviceName) {
18
            $definition = $container->getDefinition('doctrine.orm.' . $name . '_configuration');
19
            $definition->addMethodCall('addCustomHydrationMode', $hydrator);
20
        }
21
    }
22
}
23