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 ( bcf355...5f0106 )
by Edi
02:01 queued 18s
created

MetaTagHandlersCompilerPass   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 4
dl 0
loc 30
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B process() 0 24 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Netgen\Bundle\OpenGraphBundle\DependencyInjection\Compiler;
6
7
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\DependencyInjection\Exception\LogicException;
10
use Symfony\Component\DependencyInjection\Reference;
11
12
class MetaTagHandlersCompilerPass implements CompilerPassInterface
13
{
14
    /**
15
     * Adds all registered meta tag handlers to the registry.
16
     */
17
    public function process(ContainerBuilder $container): void
18
    {
19
        $metaTagHandlers = $container->findTaggedServiceIds('netgen_open_graph.meta_tag_handler');
20
        if (!empty($metaTagHandlers) && $container->hasDefinition('netgen_open_graph.handler_registry')) {
21
            $handlerRegistry = $container->getDefinition('netgen_open_graph.handler_registry');
22
            foreach ($metaTagHandlers as $serviceId => $metaTagHandler) {
23
                foreach ($metaTagHandler as $tag) {
24
                    if (!isset($tag['alias'])) {
25
                        throw new LogicException(
26
                            'netgen_open_graph.meta_tag_handler service tag needs an "alias" attribute to identify the handler. None given.'
27
                        );
28
                    }
29
30
                    $handlerRegistry->addMethodCall(
31
                        'addHandler',
32
                        [
33
                            $tag['alias'],
34
                            new Reference($serviceId),
35
                        ]
36
                    );
37
                }
38
            }
39
        }
40
    }
41
}
42