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::process()   B

Complexity

Conditions 6
Paths 5

Size

Total Lines 24

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 24
rs 8.9137
c 0
b 0
f 0
cc 6
nc 5
nop 1
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