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 (#4)
by Jérémiah
06:39
created

ConfigExpressionProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 90%

Importance

Changes 5
Bugs 1 Features 2
Metric Value
wmc 2
c 5
b 1
f 2
lcom 0
cbo 2
dl 0
loc 41
ccs 18
cts 20
cp 0.9
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B getFunctions() 0 38 2
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\ExpressionLanguage;
13
14
use Overblog\GraphQLBundle\Relay\Node\GlobalId;
15
use Symfony\Component\ExpressionLanguage\ExpressionFunction;
16
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
17
18
class ConfigExpressionProvider implements ExpressionFunctionProviderInterface
19
{
20 46
    public function getFunctions()
21
    {
22
        return [
23
            new ExpressionFunction('service', function () {}, function (array $variables, $value) {
24 1
                return $variables['container']->get($value);
25 46
            }),
26
27
            new ExpressionFunction('parameter', function () {}, function (array $variables, $value) {
28 1
                return $variables['container']->getParameter($value);
29 46
            }),
30
31
            new ExpressionFunction('isTypeOf', function () {}, function (array $variables, $className) {
32 1
                return $variables['value'] instanceof $className;
33 46
            }),
34
35
            new ExpressionFunction('resolver', function () {}, function (array $variables, $alias, array $args = []) {
36
                return $variables['container']->get('overblog_graphql.resolver_resolver')->resolve([$alias, $args]);
37 46
            }),
38
39
            new ExpressionFunction('mutation', function () {}, function (array $variables, $alias, array $args = []) {
40
                return $variables['container']->get('overblog_graphql.mutation_resolver')->resolve([$alias, $args]);
41 46
            }),
42
43
            new ExpressionFunction('globalId', function () {}, function (array $variables, $id, $typeName = null) {
44 1
                $type = !empty($typeName) ? $typeName : $variables['info']->parentType->name;
45
46 1
                return GlobalId::toGlobalId($type, $id);
47 46
            }),
48
49
            new ExpressionFunction('fromGlobalId', function () {}, function (array $variables, $globalId) {
50 1
                return GlobalId::fromGlobalId($globalId);
51 46
            }),
52
53 46
            new ExpressionFunction('newObject', function () {}, function (array $variables, $className, array $args = []) {
54 1
                return (new \ReflectionClass($className))->newInstanceArgs($args);
55 46
            }),
56 46
        ];
57
    }
58
}
59