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
Push — master ( 8f549c...6f6f6a )
by Jérémiah
11:28
created

ConfigExpressionProvider::getFunctions()   B

Complexity

Conditions 2
Paths 1

Size

Total Lines 38
Code Lines 19

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 20
CRAP Score 2

Importance

Changes 5
Bugs 1 Features 2
Metric Value
c 5
b 1
f 2
dl 0
loc 38
ccs 20
cts 20
cp 1
rs 8.8571
cc 2
eloc 19
nc 1
nop 0
crap 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 38
    public function getFunctions()
21
    {
22
        return [
23
            new ExpressionFunction('service', function () {}, function (array $variables, $value) {
24 3
                return $variables['container']->get($value);
25 38
            }),
26
27
            new ExpressionFunction('parameter', function () {}, function (array $variables, $value) {
28 1
                return $variables['container']->getParameter($value);
29 38
            }),
30
31
            new ExpressionFunction('isTypeOf', function () {}, function (array $variables, $className) {
32 1
                return $variables['value'] instanceof $className;
33 38
            }),
34
35
            new ExpressionFunction('resolver', function () {}, function (array $variables, $alias, array $args = []) {
36 11
                return $variables['container']->get('overblog_graphql.resolver_resolver')->resolve([$alias, $args]);
37 38
            }),
38
39
            new ExpressionFunction('mutation', function () {}, function (array $variables, $alias, array $args = []) {
40 1
                return $variables['container']->get('overblog_graphql.mutation_resolver')->resolve([$alias, $args]);
41 38
            }),
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 38
            }),
48
49
            new ExpressionFunction('fromGlobalId', function () {}, function (array $variables, $globalId) {
50 1
                return GlobalId::fromGlobalId($globalId);
51 38
            }),
52
53 38
            new ExpressionFunction('newObject', function () {}, function (array $variables, $className, array $args = []) {
54 1
                return (new \ReflectionClass($className))->newInstanceArgs($args);
55 38
            }),
56 38
        ];
57
    }
58
}
59