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 — dev ( 925885...2441e9 )
by Андрей
06:27
created

PhpShellValidatorProvider   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 4
c 2
b 0
f 0
lcom 0
cbo 2
dl 0
loc 35
ccs 12
cts 12
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
B validate() 0 22 4
1
<?php
2
/**
3
 * @link    https://github.com/old-town/old-town-workflow
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\Util\PhpShell;
7
8
use OldTown\PropertySet\PropertySetInterface;
9
use OldTown\Workflow\Spi\WorkflowEntryInterface;
10
use OldTown\Workflow\TransientVars\TransientVarsInterface;
11
use OldTown\Workflow\WorkflowContextInterface;
12
use OldTown\Workflow\ValidatorInterface;
13
14
/**
15
 * Class PhpShellValidatorProvider
16
 *
17
 * @package OldTown\Workflow\Util\PhpShell
18
 */
19
class  PhpShellValidatorProvider implements ValidatorInterface, PhpShellProviderInterface
20
{
21
    /**
22
     *
23
     * @param TransientVarsInterface $transientVars
24
     * @param array $args
25
     * @param PropertySetInterface $ps
26
     * @return bool
27
     *
28
     * @throws \OldTown\Workflow\Exception\RuntimeException
29
     * @throws \OldTown\Workflow\Exception\InvalidArgumentException
30
     */
31 4
    public function validate(TransientVarsInterface $transientVars, array $args = [], PropertySetInterface $ps)
32
    {
33 4
        $script = array_key_exists(static::PHP_SCRIPT, $args) ? $args[static::PHP_SCRIPT] : '';
34
35
        /**@var WorkflowContextInterface $context */
36 4
        $context = $transientVars->offsetExists('context')  ? $transientVars['context'] : null;
37
38
        /**@var WorkflowEntryInterface $entry */
39 4
        $entry = $transientVars->offsetExists('entry') ? $transientVars['entry'] : null;
40
41
42 4
        $i = new Interpreter($script);
43
44 4
        $i->setContextParam('entry', $entry);
45 4
        $i->setContextParam('context', $context);
46 4
        $i->setContextParam('transientVars', $transientVars);
47 4
        $i->setContextParam('propertySet', $ps);
48 4
        $i->setContextParam('args', $args);
49
50
51 4
        $i->evalScript();
52 2
    }
53
}
54