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.
Passed
Branch dev (d5e133)
by Андрей
20:27 queued 13s
created

WorkflowDispatchEvent::setMetadata()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 3
nc 1
nop 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\Storage\MetadataInterface;
12
13
14
/**
15
 * Class WorkflowDispatchEvent
16
 *
17
 * @package OldTown\Workflow\ZF2\Dispatch\Dispatcher
18
 */
19
class WorkflowDispatchEvent extends Event implements WorkflowDispatchEventInterface
20
{
21
    /**
22
     * @var MvcEvent
23
     */
24
    protected $mvcEvent;
25
26
    /**
27
     * @var MetadataInterface
28
     */
29
    protected $metadata;
30
31
    /**
32
     * Данные для workflow
33
     *
34
     * @var array
35
     */
36
    protected $prepareData = [];
37
38
    /**
39
     * Результаты работы workflow
40
     *
41
     * @var mixed
42
     */
43
    protected $workflowResult = [];
44
45
    /**
46
     * @return MvcEvent
47
     */
48
    public function getMvcEvent()
49
    {
50
        if (null === $this->mvcEvent) {
51
            $errMsg = 'mvcEvent not found';
52
            throw new Exception\WorkflowDispatchEventException($errMsg);
53
        }
54
        return $this->mvcEvent;
55
    }
56
57
    /**
58
     * @param MvcEvent $mvcEvent
59
     *
60
     * @return $this
61
     */
62
    public function setMvcEvent(MvcEvent $mvcEvent)
63
    {
64
        $this->mvcEvent = $mvcEvent;
65
66
        return $this;
67
    }
68
69
    /**
70
     * @return MetadataInterface
71
     */
72
    public function getMetadata()
73
    {
74
        if (null === $this->metadata) {
75
            $errMsg = 'metadata not found';
76
            throw new Exception\WorkflowDispatchEventException($errMsg);
77
        }
78
79
        return $this->metadata;
80
    }
81
82
    /**
83
     * @param MetadataInterface $metadata
84
     *
85
     * @return $this
86
     */
87
    public function setMetadata(MetadataInterface $metadata)
88
    {
89
        $this->metadata = $metadata;
90
91
        return $this;
92
    }
93
94
    /**
95
     * анные подготовленные для workflow
96
     *
97
     * @return array
98
     */
99
    public function getPrepareData()
100
    {
101
        return $this->prepareData;
102
    }
103
104
    /**
105
     * Устанавливает данные для workflow
106
     *
107
     * @param array $prepareData
108
     *
109
     * @return $this
110
     */
111
    public function setPrepareData(array $prepareData = [])
112
    {
113
        $this->prepareData = $prepareData;
114
115
        return $this;
116
    }
117
118
    /**
119
     * Возвращает результаты работы workflow
120
     *
121
     *
122
     * @return TransitionResultInterface
123
     */
124
    public function getWorkflowResult()
125
    {
126
        return $this->workflowResult;
127
    }
128
129
    /**
130
     * Устанавливает результаты работы workflow
131
     *
132
     * @param TransitionResultInterface $workflowResult
133
     *
134
     * @return $this
135
     */
136
    public function setWorkflowResult(TransitionResultInterface $workflowResult)
137
    {
138
        $this->workflowResult = $workflowResult;
139
140
        return $this;
141
    }
142
}
143