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 ( 37e84b...c7bcbf )
by Андрей
06:51
created

EngineManager::getEntryEngine()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 6
cp 0
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
crap 6
1
<?php
2
/**
3
 * @link https://github.com/old-town/old-town-workflow
4
 * @author  Malofeykin Andrey  <[email protected]>
5
 */
6
namespace OldTown\Workflow\Engine;
7
8
use OldTown\Workflow\WorkflowInterface;
9
10
/**
11
 * Class EngineManager
12
 *
13
 * @package OldTown\Workflow\Engine
14
 */
15
class EngineManager implements EngineManagerInterface
16
{
17
    use WorkflowManagerTrait;
18
19
    /**
20
     * @var TransitionInterface
21
     */
22
    protected $transitionEngine;
23
24
    /**
25
     * @var ConditionsInterface
26
     */
27
    protected $conditionsEngine;
28
29
    /**
30
     * @var ArgsInterface
31
     */
32
    protected $argsEngine;
33
34
    /**
35
     * @var FunctionsInterface
36
     */
37
    protected $functionsEngine;
38
39
    /**
40
     * @var DataInterface
41
     */
42
    protected $dataEngine;
43
44
    /**
45
     * @var EntryInterface
46
     */
47
    protected $entryEngine;
48
49
    /**
50
     * Конструктор абстрактного движка
51
     *
52
     * AbstractEngine constructor.
53
     *
54
     * @param WorkflowInterface $wf
55
     */
56 19
    public function __construct(WorkflowInterface $wf)
57
    {
58 19
        $this->setWorkflowManager($wf);
59 19
    }
60
61
    /**
62
     * Движок  отвечающий за переходы между шагами workflow
63
     *
64
     * @return TransitionInterface
65
     */
66 18
    public function getTransitionEngine()
67
    {
68 18
        if ($this->transitionEngine) {
69 8
            return $this->transitionEngine;
70
        }
71 18
        $wfManager = $this->getWorkflowManager();
72 18
        $this->transitionEngine = new Transition($wfManager);
73
74 18
        return $this->transitionEngine;
75
    }
76
77
    /**
78
     * Устанавливает движок  отвечающий за переходы между шагами workflow
79
     *
80
     * @param TransitionInterface $transitionEngine
81
     *
82
     * @return $this
83
     */
84
    public function setTransitionEngine(TransitionInterface $transitionEngine)
85
    {
86
        $this->transitionEngine = $transitionEngine;
87
88
        return $this;
89
    }
90
91
    /**
92
     * Возвращает движок  отвечающий за работу с условиями
93
     *
94
     * @return ConditionsInterface
95
     */
96 19
    public function getConditionsEngine()
97
    {
98 19
        if ($this->conditionsEngine) {
99 17
            return $this->conditionsEngine;
100
        }
101 19
        $wfManager = $this->getWorkflowManager();
102 19
        $this->conditionsEngine = new Conditions($wfManager);
103
104 19
        return $this->conditionsEngine;
105
    }
106
107
    /**
108
     * Устанавливает движок  отвечающий за работу с условиями
109
     *
110
     * @param ConditionsInterface $conditionsEngine
111
     *
112
     * @return $this
113
     */
114
    public function setConditionsEngine($conditionsEngine)
115
    {
116
        $this->conditionsEngine = $conditionsEngine;
117
118
        return $this;
119
    }
120
121
    /**
122
     * Устанавливает движок  отвечающий за работу с аргументами
123
     *
124
     * @return ArgsInterface
125
     */
126 19
    public function getArgsEngine()
127
    {
128 19
        if ($this->argsEngine) {
129 16
            return $this->argsEngine;
130
        }
131 19
        $wfManager = $this->getWorkflowManager();
132 19
        $this->argsEngine = new Args($wfManager);
133
134 19
        return $this->argsEngine;
135
    }
136
137
    /**
138
     * Возвращает движок отвечающий за работу с аргументами
139
     *
140
     * @param ArgsInterface $argsEngine
141
     *
142
     * @return $this
143
     */
144
    public function setArgsEngine(ArgsInterface $argsEngine)
145
    {
146
        $this->argsEngine = $argsEngine;
147
148
        return $this;
149
    }
150
151
    /**
152
     * Возвращает движок отвечающий за работу с функциями
153
     *
154
     * @return FunctionsInterface
155
     */
156 17
    public function getFunctionsEngine()
157
    {
158 17
        if ($this->functionsEngine) {
159 16
            return $this->functionsEngine;
160
        }
161 17
        $wfManager = $this->getWorkflowManager();
162 17
        $this->functionsEngine = new Functions($wfManager);
163
164 17
        return $this->functionsEngine;
165
    }
166
167
    /**
168
     * Устанавливает движок отвечающий за работу с функциями
169
     *
170
     * @param FunctionsInterface $functionsEngine
171
     *
172
     * @return $this
173
     */
174
    public function setFunctionsEngine(FunctionsInterface $functionsEngine)
175
    {
176
        $this->functionsEngine = $functionsEngine;
177
178
        return $this;
179
    }
180
181
    /**
182
     * Возвращает движок для работы с данными
183
     *
184
     * @return DataInterface
185
     */
186 19
    public function getDataEngine()
187
    {
188 19
        if ($this->dataEngine) {
189 19
            return $this->dataEngine;
190
        }
191 19
        $wfManager = $this->getWorkflowManager();
192 19
        $this->dataEngine = new Data($wfManager);
193
194
195 19
        return $this->dataEngine;
196
    }
197
198
    /**
199
     * Устанавливает движок для работы с данными
200
     *
201
     * @param DataInterface $dataEngine
202
     *
203
     * @return $this
204
     */
205
    public function setDataEngine(DataInterface $dataEngine)
206
    {
207
        $this->dataEngine = $dataEngine;
208
209
        return $this;
210
    }
211
212
    /**
213
     * Возвращает движок для работы с процессами workflow
214
     *
215
     * @return EntryInterface
216
     */
217
    public function getEntryEngine()
218
    {
219
        if ($this->entryEngine) {
220
            return $this->entryEngine;
221
        }
222
        $wfManager = $this->getWorkflowManager();
223
        $this->entryEngine = new Entry($wfManager);
224
225
226
227
        return $this->entryEngine;
228
    }
229
230
    /**
231
     * Устанавливает движок для работы с процессами workflow
232
     *
233
     * @param EntryInterface $entryEngine
234
     *
235
     * @return $this
236
     */
237
    public function setEntryEngine(EntryInterface $entryEngine)
238
    {
239
        $this->entryEngine = $entryEngine;
240
241
        return $this;
242
    }
243
}
244