@@ -121,7 +121,7 @@ public function __construct(
121
121
public function get ($ path = '' )
122
122
{
123
123
if ($ path === '' ) {
124
- $ this ->data = array_replace_recursive ($ this ->loadAllData () , $ this ->data );
124
+ $ this ->data = array_replace_recursive ($ this ->data , $ this ->loadAllData () );
125
125
126
126
return $ this ->data ;
127
127
}
@@ -142,7 +142,7 @@ private function getWithParts($path)
142
142
if (count ($ pathParts ) === 1 && $ pathParts [0 ] !== ScopeInterface::SCOPE_DEFAULT ) {
143
143
if (!isset ($ this ->data [$ pathParts [0 ]])) {
144
144
$ data = $ this ->readData ();
145
- $ this ->data = array_replace_recursive ( $ data , $ this ->data );
145
+ $ this ->data = $ this ->postProcessor -> process ( $ data );
146
146
}
147
147
148
148
return $ this ->data [$ pathParts [0 ]];
@@ -152,7 +152,7 @@ private function getWithParts($path)
152
152
153
153
if ($ scopeType === ScopeInterface::SCOPE_DEFAULT ) {
154
154
if (!isset ($ this ->data [$ scopeType ])) {
155
- $ this ->data = array_replace_recursive ($ this ->loadDefaultScopeData ( $ scopeType ) , $ this ->data );
155
+ $ this ->data = array_replace_recursive ($ this ->data , $ this ->loadDefaultScopeData ( $ scopeType ) );
156
156
}
157
157
158
158
return $ this ->getDataByPathParts ($ this ->data [$ scopeType ], $ pathParts );
@@ -162,10 +162,7 @@ private function getWithParts($path)
162
162
163
163
if (!isset ($ this ->data [$ scopeType ][$ scopeId ])) {
164
164
$ scopeData = $ this ->loadScopeData ($ scopeType , $ scopeId );
165
-
166
- if (!isset ($ this ->data [$ scopeType ][$ scopeId ])) {
167
- $ this ->data = array_replace_recursive ($ scopeData , $ this ->data );
168
- }
165
+ $ this ->data = array_replace_recursive ($ this ->data , $ scopeData );
169
166
}
170
167
171
168
return isset ($ this ->data [$ scopeType ][$ scopeId ])
@@ -187,6 +184,7 @@ private function loadAllData()
187
184
} else {
188
185
$ data = $ this ->serializer ->unserialize ($ cachedData );
189
186
}
187
+ $ data = $ this ->postProcessor ->process ($ data );
190
188
191
189
return $ data ;
192
190
}
@@ -207,6 +205,7 @@ private function loadDefaultScopeData($scopeType)
207
205
} else {
208
206
$ data = [$ scopeType => $ this ->serializer ->unserialize ($ cachedData )];
209
207
}
208
+ $ data = $ this ->postProcessor ->process ($ data );
210
209
211
210
return $ data ;
212
211
}
@@ -237,6 +236,7 @@ private function loadScopeData($scopeType, $scopeId)
237
236
} else {
238
237
$ data = [$ scopeType => [$ scopeId => $ this ->serializer ->unserialize ($ cachedData )]];
239
238
}
239
+ $ data = $ this ->postProcessor ->process ($ data );
240
240
241
241
return $ data ;
242
242
}
@@ -308,9 +308,6 @@ private function getDataByPathParts($data, $pathParts)
308
308
private function readData (): array
309
309
{
310
310
$ this ->data = $ this ->reader ->read ();
311
- $ this ->data = $ this ->postProcessor ->process (
312
- $ this ->data
313
- );
314
311
315
312
return $ this ->data ;
316
313
}
0 commit comments