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

ExpressionLanguage   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Test Coverage

Coverage 76.19%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A evaluate() 0 6 1
A addValues() 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\ExpressionLanguage;
13
14
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
15
use Symfony\Component\ExpressionLanguage\ExpressionLanguage as BaseExpressionLanguage;
16
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface;
17
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
18
19
class ExpressionLanguage extends BaseExpressionLanguage
20
{
21
    use ContainerAwareTrait;
22
23 38
    public function __construct(ParserCacheInterface $parser = null, array $providers = [])
24
    {
25
        // prepend the default provider to let users override it easily
26 38
        array_unshift($providers, new ConfigExpressionProvider());
27 38
        array_unshift($providers, new AuthorizationExpressionProvider());
28
29 38
        parent::__construct($parser, $providers);
30 38
    }
31
32 29
    public function evaluate($expression, $values = [])
33
    {
34 29
        $this->addValues($values);
35
36 29
        return parent::evaluate($expression, $values);
37
    }
38
39 29
    private function addValues(&$values)
40 1
    {
41 29
        $values['container'] = $this->container;
42
43 29
        if ($this->container->has('request_stack')) {
44 14
            $values['request'] = $this->container->get('request_stack')->getCurrentRequest();
45 14
        }
46
47 29
        if ($this->container->has('security.token_storage')) {
48
            $values['token'] = $this->container->get('security.token_storage')->getToken();
49
            if ($values['token'] instanceof TokenInterface) {
50
                $values['user'] = $values['token']->getUser();
51
            }
52
        }
53 29
    }
54
}
55