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.

ContainerAwareExpressionLanguage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 52
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A compile() 0 4 1
A evaluate() 0 4 1
A parse() 0 4 1
1
<?php
2
/**
3
 * This file is part of the Global Trading Technologies Ltd workflow-extension-bundle package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * (c) fduch <[email protected]>
9
 * @date 19.07.16
10
 */
11
12
namespace Gtt\Bundle\WorkflowExtensionsBundle\ExpressionLanguage;
13
14
use Symfony\Component\DependencyInjection\ContainerInterface;
15
use Symfony\Component\DependencyInjection\ExpressionLanguage;
16
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
17
use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface;
18
19
/**
20
 * Extends DI Expression Language with container variable holds ContainerInterface implementation
21
 */
22
class ContainerAwareExpressionLanguage extends ExpressionLanguage
23
{
24
    /**
25
     * DI ContainerInterface implementation
26
     *
27
     * @var ContainerInterface
28
     */
29
    private $container;
30
31
    /**
32
     * ContainerAwareExpressionLanguage constructor
33
     *
34
     * @param ContainerInterface                    $container DI Container
35
     * @param ParserCacheInterface                  $cache     cache
36
     * @param ExpressionFunctionProviderInterface[] $providers providers list
37
     */
38
    public function __construct(ContainerInterface $container, ParserCacheInterface $cache = null, array $providers = array())
39
    {
40
        $this->container = $container;
41
        parent::__construct($cache, $providers);
42
    }
43
44
    /**
45
     * Compile an expression with ContainerInterface context
46
     *
47
     * {@inheritdoc}
48
     */
49
    public function compile($expression, $names = array())
50
    {
51
        return parent::compile($expression, array_unique(array_merge($names, ["container"])));
52
    }
53
54
    /**
55
     * Evaluate an expression with ContainerInterface context
56
     *
57
     * {@inheritdoc}
58
     */
59
    public function evaluate($expression, $values = array())
60
    {
61
        return parent::evaluate($expression, $values + ["container" => $this->container]);
62
    }
63
64
    /**
65
     * Parse an expression with ContainerInterface context
66
     *
67
     * {@inheritdoc}
68
     */
69
    public function parse($expression, $names)
70
    {
71
        return parent::parse($expression, array_unique(array_merge($names, ["container"])));
72
    }
73
}