1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* This file is part of Phiremock. |
4
|
|
|
* |
5
|
|
|
* Phiremock is free software: you can redistribute it and/or modify |
6
|
|
|
* it under the terms of the GNU Lesser General Public License as published by |
7
|
|
|
* the Free Software Foundation, either version 3 of the License, or |
8
|
|
|
* (at your option) any later version. |
9
|
|
|
* |
10
|
|
|
* Phiremock is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
|
|
|
* GNU General Public License for more details. |
14
|
|
|
* |
15
|
|
|
* You should have received a copy of the GNU General Public License |
16
|
|
|
* along with Phiremock. If not, see <http://www.gnu.org/licenses/>. |
17
|
|
|
*/ |
18
|
|
|
|
19
|
|
|
namespace Mcustiel\Phiremock\Domain; |
20
|
|
|
|
21
|
|
|
use Mcustiel\Phiremock\Domain\Options\ScenarioName; |
22
|
|
|
use Mcustiel\Phiremock\Domain\Options\ScenarioState; |
23
|
|
|
|
24
|
|
|
class StateConditions |
25
|
|
|
{ |
26
|
|
|
/** @var ScenarioName */ |
27
|
|
|
private $scenarioName; |
28
|
|
|
|
29
|
|
|
/** @var ScenarioState */ |
30
|
|
|
private $scenarioStateIs; |
31
|
|
|
|
32
|
|
|
public function __construct( |
33
|
|
|
ScenarioName $scenarioName = null, |
34
|
|
|
ScenarioState $currentScenarioState = null |
35
|
|
|
) { |
36
|
|
|
$this->scenarioName = $scenarioName; |
37
|
|
|
$this->scenarioStateIs = $currentScenarioState; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** @return bool */ |
41
|
|
|
public function hasScenarioName() |
42
|
|
|
{ |
43
|
|
|
return null !== $this->scenarioName; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** @return ScenarioName|null */ |
47
|
|
|
public function getScenarioName() |
48
|
|
|
{ |
49
|
|
|
return $this->scenarioName; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** @return bool */ |
53
|
|
|
public function hasScenarioStateIs() |
54
|
|
|
{ |
55
|
|
|
return null !== $this->scenarioStateIs; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** @return ScenarioState|null */ |
59
|
|
|
public function getScenarioStateIs() |
60
|
|
|
{ |
61
|
|
|
return $this->scenarioStateIs; |
62
|
|
|
} |
63
|
|
|
} |
64
|
|
|
|