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.

Workflow::offsetSet()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 2
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * See class comment
4
 *
5
 * PHP Version 5
6
 *
7
 * @category Netresearch
8
 * @package  Netresearch\Kite
9
 * @author   Christian Opitz <[email protected]>
10
 * @license  http://www.netresearch.de Netresearch Copyright
11
 * @link     http://www.netresearch.de
12
 */
13
14
namespace Netresearch\Kite;
15
16
/**
17
 * Base class for Workflows
18
 *
19
 * @category Netresearch
20
 * @package  Netresearch\Kite
21
 * @author   Christian Opitz <[email protected]>
22
 * @license  http://www.netresearch.de Netresearch Copyright
23
 * @link     http://www.netresearch.de
24
 */
25
abstract class Workflow extends Tasks
26
{
27
    /**
28
     * @var bool
29
     */
30
    private $assembled = false;
31
32
    /**
33
     * Variable configuration
34
     *
35
     * @return array
36
     */
37
    protected function configureVariables()
38
    {
39
        return array(
40
            'tasks' => null,
41
            'task' => null,
42
            'workflow' => null,
43
            'script' => null
44
        ) + parent::configureVariables();
45
    }
46
47
    /**
48
     * Called from parent task as soon as task is ready to run - which doesn't
49
     * necessarely mean that it'll be run.
50
     *
51
     * @return void
52
     */
53
    protected function initialize()
54
    {
55
        parent::initialize();
56
57
        if (!$this->assembled) {
58
            $this->assemble();
59
            $this->assembled = true;
60
        }
61
    }
62
63
    /**
64
     * Override to create the tasks from the according options
65
     *
66
     * @param string $name  Variable name
67
     * @param mixed  $value Variable value
68
     *
69
     * @return void
70
     */
71
    public function offsetSet($name, $value)
72
    {
73
        if (in_array($name, ['workflow', 'script', 'task', 'tasks'], true)) {
74
            throw new Exception($name . ' not allowed on workflows');
75
        }
76
        parent::offsetSet($name, $value);
77
    }
78
79
80
    /**
81
     * Run an array of tasks
82
     *
83
     * @return $this
84
     */
85
    public function run()
86
    {
87
        return parent::run();
88
    }
89
90
    /**
91
     * Override to assemble the tasks
92
     *
93
     * @return void
94
     */
95
    abstract public function assemble();
96
}
97
?>
98