Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#40)
by Jérémiah
13:22
created

TypesPass   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 6
c 1
b 1
f 0
lcom 0
cbo 4
dl 0
loc 36
ccs 21
cts 21
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A process() 0 17 2
A processConfig() 0 15 4
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Definition;
17
use Symfony\Component\DependencyInjection\Reference;
18
use Symfony\Component\ExpressionLanguage\Expression;
19
20
class TypesPass implements CompilerPassInterface
21
{
22 8
    public function process(ContainerBuilder $container)
23
    {
24 8
        $config = $container->getParameter('overblog_graphql_types.config');
25 8
        $classes = array_keys($container->get('overblog_graphql.cache_compiler')->compile($this->processConfig($config)));
26
27 8
        foreach ($classes as $class) {
28 8
            $name = $class::getName();
29
30 8
            $customTypeId = sprintf('overblog_graphql.definition.custom_%s_type', $container->underscore($name));
31
32
            $container
33 8
                ->setDefinition($customTypeId, new Definition($class))
34 8
                ->setArguments([new Reference('service_container')])
35 8
                ->addTag('overblog_graphql.type', ['alias' => $name])
36
            ;
37 8
        }
38 8
    }
39
40 8
    private function processConfig(array $configs)
41
    {
42 8
        return array_map(
43 8
            function ($v) {
44 8
                if (is_array($v)) {
45 8
                    return call_user_func([$this, 'processConfig'], $v);
46 8
                } elseif (is_string($v) && 0 === strpos($v, '@=')) {
47 7
                    return new Expression(substr($v, 2));
48
                }
49
50 8
                return $v;
51 8
            },
52
            $configs
53 8
        );
54
    }
55
}
56