1 | <?php |
||
20 | abstract class AbstractScope implements ScopeInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $scopeIdentifier; |
||
26 | |||
27 | /** |
||
28 | * @var TransformInterface |
||
29 | */ |
||
30 | protected $transform; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $parentScopes = []; |
||
36 | |||
37 | /** |
||
38 | * Scope constructor. |
||
39 | * @param TransformInterface $transform |
||
40 | * @param string|null $scopeIdentifier |
||
41 | * @param array $parentScopes |
||
42 | */ |
||
43 | public function __construct( |
||
52 | |||
53 | /** |
||
54 | * @return TransformInterface |
||
55 | */ |
||
56 | public function getTransform(): TransformInterface |
||
60 | |||
61 | /** |
||
62 | * @param $key |
||
63 | * @return ParamBag |
||
64 | */ |
||
65 | public function getParams(string $key = null): ParamBag |
||
71 | |||
72 | /** |
||
73 | * Get the current identifier. |
||
74 | * |
||
75 | * @return string|null |
||
76 | */ |
||
77 | public function getScopeIdentifier() |
||
81 | |||
82 | /** |
||
83 | * Get the unique identifier for this scope. |
||
84 | * |
||
85 | * @param string $appendIdentifier |
||
86 | * |
||
87 | * @return string |
||
88 | */ |
||
89 | public function getIdentifier(string $appendIdentifier = null): string |
||
102 | |||
103 | /** |
||
104 | * Getter for parentScopes. |
||
105 | * |
||
106 | * @return array |
||
107 | */ |
||
108 | public function getParentScopes(): array |
||
112 | |||
113 | /** |
||
114 | * @param TransformerInterface|callable $transformer |
||
115 | * @param mixed $data |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function transform(callable $transformer, $data) |
||
122 | |||
123 | /** |
||
124 | * @param $val |
||
125 | * @param $data |
||
126 | * @param string|null $key |
||
127 | * @return array|string|null |
||
128 | */ |
||
129 | protected function parseValue($val, $data, string $key = null) |
||
137 | |||
138 | /** |
||
139 | * @param string $identifier |
||
140 | * @return static |
||
141 | */ |
||
142 | public function childScope(string $identifier) |
||
153 | |||
154 | /** |
||
155 | * Check, if this is the root scope. |
||
156 | * |
||
157 | * @return bool |
||
158 | */ |
||
159 | protected function isRootScope(): bool |
||
163 | } |
||
164 |