1 | <?php namespace Limoncello\Validation\Execution; |
||
27 | class ContextStorage implements ContextStorageInterface, BlockStateInterface, BlockPropertiesInterface |
||
28 | { |
||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | private $states = []; |
||
33 | |||
34 | /** |
||
35 | * @var int |
||
36 | */ |
||
37 | private $currentBlockId = 0; |
||
38 | |||
39 | /** |
||
40 | * @var |
||
41 | */ |
||
42 | private $blocks; |
||
43 | |||
44 | /** |
||
45 | * @var null|ContainerInterface |
||
46 | */ |
||
47 | private $container; |
||
48 | |||
49 | /** |
||
50 | * @param array $blocks |
||
51 | * @param ContainerInterface|null $container |
||
52 | */ |
||
53 | 18 | public function __construct(array $blocks, ContainerInterface $container = null) |
|
58 | |||
59 | /** |
||
60 | * @inheritdoc |
||
61 | */ |
||
62 | 1 | public function getStates(): BlockStateInterface |
|
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | 16 | public function getProperties(): BlockPropertiesInterface |
|
74 | |||
75 | /** |
||
76 | * @inheritdoc |
||
77 | */ |
||
78 | 1 | public function getContainer(): ?ContainerInterface |
|
82 | |||
83 | /** |
||
84 | * @inheritdoc |
||
85 | */ |
||
86 | 16 | public function getCurrentBlockId(): int |
|
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | 18 | public function setCurrentBlockId(int $index): ContextStorageInterface |
|
100 | |||
101 | /** |
||
102 | * @inheritdoc |
||
103 | */ |
||
104 | 1 | public function clear(): ContextStorageInterface |
|
111 | |||
112 | /** |
||
113 | * @inheritdoc |
||
114 | */ |
||
115 | 16 | public function getProperty(int $key, $default = null) |
|
119 | |||
120 | /** |
||
121 | * @inheritdoc |
||
122 | */ |
||
123 | 1 | public function getState(int $key, $default = null) |
|
127 | |||
128 | /** |
||
129 | * @inheritdoc |
||
130 | */ |
||
131 | 1 | public function setState(int $key, $value): BlockStateInterface |
|
137 | } |
||
138 |