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.
Completed
Push — master ( aa4ff3...5266c0 )
by Alex
22:35
created

Executor   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A execute() 0 15 3
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
 *
10
 * Date: 23.09.16
11
 */
12
13
namespace Gtt\Bundle\WorkflowExtensionsBundle\Action;
14
15
use Gtt\Bundle\WorkflowExtensionsBundle\Action\Reference\ActionReferenceInterface;
16
use Gtt\Bundle\WorkflowExtensionsBundle\WorkflowContext;
17
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
18
use Symfony\Component\DependencyInjection\ContainerInterface;
19
20
/**
21
 * Action executor
22
 *
23
 * @author fduch <[email protected]>
24
 */
25
class Executor
26
{
27
    /**
28
     * Action registry
29
     *
30
     * @var Registry
31
     */
32
    private $registry;
33
34
    /**
35
     * Container DI
36
     *
37
     * @var ContainerInterface
38
     */
39
    private $container;
40
41
    /**
42
     * Executor constructor.
43
     *
44
     * @param Registry           $registry  action registry
45
     * @param ContainerInterface $container container DI
46
     */
47
    public function __construct(Registry $registry, ContainerInterface $container)
48
    {
49
        $this->registry  = $registry;
50
        $this->container = $container;
51
    }
52
53
    /**
54
     * Executes action
55
     *
56
     * @param WorkflowContext $workflowContext workflow context
57
     * @param string          $actionName      action name
58
     * @param array           $args            action arguments
59
     *
60
     * @return mixed
61
     */
62
    public function execute(WorkflowContext $workflowContext, $actionName, array $args = [])
63
    {
64
        $actionReference = $this->registry->get($actionName);
65
66
        if ($actionReference->getType() == ActionReferenceInterface::TYPE_WORKFLOW) {
67
            array_unshift($args, $workflowContext);
68
        }
69
70
        if ($actionReference instanceof ContainerAwareInterface) {
71
            // container should be injected to allow action to use service as an method owner
72
            $actionReference->setContainer($this->container);
73
        }
74
75
        return $actionReference->invoke($args);
76
    }
77
}