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.

WorkflowDispatchEvent   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 165
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 2

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 13
c 2
b 0
f 0
lcom 3
cbo 2
dl 0
loc 165
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getMvcEvent() 0 8 2
A setMvcEvent() 0 6 1
A getMetadata() 0 9 2
A setMetadata() 0 6 1
A getPrepareData() 0 4 1
A setPrepareData() 0 6 1
A getWorkflowResult() 0 4 1
A setWorkflowResult() 0 6 1
A getRunWorkflowParam() 0 8 2
A setRunWorkflowParam() 0 6 1
1
<?php
2
/**
3
 * @link https://github.com/old-town/workflow-zf2-dispatch
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\ZF2\Dispatch\Dispatcher;
7
8
use OldTown\Workflow\ZF2\ServiceEngine\Workflow\TransitionResultInterface;
9
use Zend\EventManager\Event;
10
use Zend\Mvc\MvcEvent;
11
use OldTown\Workflow\ZF2\Dispatch\Metadata\Target\Dispatch\MetadataInterface;
12
13
14
15
/**
16
 * Class WorkflowDispatchEvent
17
 *
18
 * @package OldTown\Workflow\ZF2\Dispatch\Dispatcher
19
 */
20
class WorkflowDispatchEvent extends Event implements WorkflowDispatchEventInterface
21
{
22
    /**
23
     * @var MvcEvent
24
     */
25
    protected $mvcEvent;
26
27
    /**
28
     * @var MetadataInterface
29
     */
30
    protected $metadata;
31
32
    /**
33
     * Данные для workflow
34
     *
35
     * @var array
36
     */
37
    protected $prepareData = [];
38
39
    /**
40
     * Результаты работы workflow
41
     *
42
     * @var mixed
43
     */
44
    protected $workflowResult = [];
45
46
    /**
47
     * Параметры для запуска workflow
48
     *
49
     * @var RunWorkflowParamInterface
50
     */
51
    protected $runWorkflowParam;
52
53
    /**
54
     * @return MvcEvent
55
     *
56
     * @throws Exception\WorkflowDispatchEventException
57
     */
58
    public function getMvcEvent()
59
    {
60
        if (null === $this->mvcEvent) {
61
            $errMsg = 'mvcEvent not found';
62
            throw new Exception\WorkflowDispatchEventException($errMsg);
63
        }
64
        return $this->mvcEvent;
65
    }
66
67
    /**
68
     * @param MvcEvent $mvcEvent
69
     *
70
     * @return $this
71
     */
72
    public function setMvcEvent(MvcEvent $mvcEvent)
73
    {
74
        $this->mvcEvent = $mvcEvent;
75
76
        return $this;
77
    }
78
79
    /**
80
     * @return MetadataInterface
81
     *
82
     * @throws Exception\WorkflowDispatchEventException
83
     */
84
    public function getMetadata()
85
    {
86
        if (null === $this->metadata) {
87
            $errMsg = 'metadata not found';
88
            throw new Exception\WorkflowDispatchEventException($errMsg);
89
        }
90
91
        return $this->metadata;
92
    }
93
94
    /**
95
     * @param MetadataInterface $metadata
96
     *
97
     * @return $this
98
     */
99
    public function setMetadata(MetadataInterface $metadata)
100
    {
101
        $this->metadata = $metadata;
102
103
        return $this;
104
    }
105
106
    /**
107
     * анные подготовленные для workflow
108
     *
109
     * @return array
110
     */
111
    public function getPrepareData()
112
    {
113
        return $this->prepareData;
114
    }
115
116
    /**
117
     * Устанавливает данные для workflow
118
     *
119
     * @param array $prepareData
120
     *
121
     * @return $this
122
     */
123
    public function setPrepareData(array $prepareData = [])
124
    {
125
        $this->prepareData = $prepareData;
126
127
        return $this;
128
    }
129
130
    /**
131
     * Возвращает результаты работы workflow
132
     *
133
     *
134
     * @return TransitionResultInterface
135
     */
136
    public function getWorkflowResult()
137
    {
138
        return $this->workflowResult;
139
    }
140
141
    /**
142
     * Устанавливает результаты работы workflow
143
     *
144
     * @param TransitionResultInterface $workflowResult
145
     *
146
     * @return $this
147
     */
148
    public function setWorkflowResult(TransitionResultInterface $workflowResult)
149
    {
150
        $this->workflowResult = $workflowResult;
151
152
        return $this;
153
    }
154
155
    /**
156
     * Параметры для запуска workflow
157
     *
158
     * @return RunWorkflowParamInterface
159
     *
160
     * @throws Exception\WorkflowDispatchEventException
161
     */
162
    public function getRunWorkflowParam()
163
    {
164
        if (null === $this->runWorkflowParam) {
165
            $errMsg = 'runWorkflowParam not found';
166
            throw new Exception\WorkflowDispatchEventException($errMsg);
167
        }
168
        return $this->runWorkflowParam;
169
    }
170
171
    /**
172
     * Устанавливает параметры для запуска workflow
173
     *
174
     * @param RunWorkflowParamInterface $runWorkflowParam
175
     *
176
     * @return $this
177
     */
178
    public function setRunWorkflowParam(RunWorkflowParamInterface $runWorkflowParam)
179
    {
180
        $this->runWorkflowParam = $runWorkflowParam;
181
182
        return $this;
183
    }
184
}
185