1 | <?php declare(strict_types=1); |
||
29 | class ContextStorage implements ContextStorageInterface, BlockStateInterface, BlockPropertiesInterface |
||
30 | { |
||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | private $states = []; |
||
35 | |||
36 | /** |
||
37 | * @var int |
||
38 | */ |
||
39 | private $currentBlockId = 0; |
||
40 | |||
41 | /** |
||
42 | * @var |
||
43 | */ |
||
44 | private $blocks; |
||
45 | |||
46 | /** |
||
47 | * @var null|ContainerInterface |
||
48 | */ |
||
49 | private $container; |
||
50 | |||
51 | /** |
||
52 | * @param array $blocks |
||
53 | * @param ContainerInterface|null $container |
||
54 | */ |
||
55 | 21 | public function __construct(array $blocks, ContainerInterface $container = null) |
|
60 | |||
61 | /** |
||
62 | * @inheritdoc |
||
63 | */ |
||
64 | 1 | public function getStates(): BlockStateInterface |
|
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | 18 | public function getProperties(): BlockPropertiesInterface |
|
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | 2 | public function getContainer(): ?ContainerInterface |
|
84 | |||
85 | /** |
||
86 | * @inheritdoc |
||
87 | */ |
||
88 | 18 | public function getCurrentBlockId(): int |
|
92 | |||
93 | /** |
||
94 | * @inheritdoc |
||
95 | */ |
||
96 | 21 | public function setCurrentBlockId(int $index): ContextStorageInterface |
|
102 | |||
103 | /** |
||
104 | * @inheritdoc |
||
105 | */ |
||
106 | 1 | public function clear(): ContextStorageInterface |
|
113 | |||
114 | /** |
||
115 | * @inheritdoc |
||
116 | */ |
||
117 | 18 | public function getProperty(int $key, $default = null) |
|
121 | |||
122 | /** |
||
123 | * @inheritdoc |
||
124 | */ |
||
125 | 1 | public function getState(int $key, $default = null) |
|
129 | |||
130 | /** |
||
131 | * @inheritdoc |
||
132 | */ |
||
133 | 1 | public function setState(int $key, $value): BlockStateInterface |
|
139 | } |
||
140 |