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 ( fead3a...925885 )
by Андрей
07:22
created

PhpShellValidatorProvider::validate()   B

Complexity

Conditions 4
Paths 8

Size

Total Lines 22
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 4.0092

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 22
ccs 11
cts 12
cp 0.9167
rs 8.9197
cc 4
eloc 11
nc 8
nop 3
crap 4.0092
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 2
    public function validate(TransientVarsInterface $transientVars, array $args = [], PropertySetInterface $ps)
32
    {
33 2
        $script = array_key_exists(static::PHP_SCRIPT, $args) ? $args[static::PHP_SCRIPT] : '';
34
35
        /**@var WorkflowContextInterface $context */
36 2
        $context = $transientVars->offsetExists('context')  ? $transientVars['context'] : null;
37
38
        /**@var WorkflowEntryInterface $entry */
39 2
        $entry = $transientVars->offsetExists('entry') ? $transientVars['entry'] : null;
40
41
42 2
        $i = new Interpreter($script);
43
44 2
        $i->setContextParam('entry', $entry);
45 2
        $i->setContextParam('context', $context);
46 2
        $i->setContextParam('transientVars', $transientVars);
47 2
        $i->setContextParam('propertySet', $ps);
48 2
        $i->setContextParam('args', $args);
49
50
51 2
        $i->evalScript();
52
    }
53
}
54