@@ -92,7 +92,8 @@ class PluginList extends Scoped implements InterceptionPluginList
92
92
* @param ObjectManagerInterface $objectManager
93
93
* @param ClassDefinitions $classDefinitions
94
94
* @param array $scopePriorityScheme
95
- * @param string $cacheId
95
+ * @param string|null $cacheId
96
+ * @param SerializerInterface|null $serializer
96
97
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
97
98
*/
98
99
public function __construct (
@@ -105,9 +106,11 @@ public function __construct(
105
106
ObjectManagerInterface $ objectManager ,
106
107
ClassDefinitions $ classDefinitions ,
107
108
array $ scopePriorityScheme = ['global ' ],
108
- $ cacheId = 'plugins '
109
+ $ cacheId = 'plugins ' ,
110
+ SerializerInterface $ serializer = null
109
111
) {
110
- parent ::__construct ($ reader , $ configScope , $ cache , $ cacheId );
112
+ $ serializer = $ serializer ?: $ objectManager ->get (Serialize::class);
113
+ parent ::__construct ($ reader , $ configScope , $ cache , $ cacheId , $ serializer );
111
114
$ this ->_omConfig = $ omConfig ;
112
115
$ this ->_relations = $ relations ;
113
116
$ this ->_definitions = $ definitions ;
@@ -277,7 +280,7 @@ protected function _loadScopedData()
277
280
$ cacheId = implode ('| ' , $ this ->_scopePriorityScheme ) . "| " . $ this ->_cacheId ;
278
281
$ data = $ this ->_cache ->load ($ cacheId );
279
282
if ($ data ) {
280
- list ($ this ->_data , $ this ->_inherited , $ this ->_processed ) = $ this ->getSerializer () ->unserialize ($ data );
283
+ list ($ this ->_data , $ this ->_inherited , $ this ->_processed ) = $ this ->serializer ->unserialize ($ data );
281
284
foreach ($ this ->_scopePriorityScheme as $ scope ) {
282
285
$ this ->_loadedScopes [$ scope ] = true ;
283
286
}
@@ -311,7 +314,7 @@ protected function _loadScopedData()
311
314
$ this ->_inheritPlugins ($ class );
312
315
}
313
316
$ this ->_cache ->save (
314
- $ this ->getSerializer () ->serialize ([$ this ->_data , $ this ->_inherited , $ this ->_processed ]),
317
+ $ this ->serializer ->serialize ([$ this ->_data , $ this ->_inherited , $ this ->_processed ]),
315
318
$ cacheId
316
319
);
317
320
}
@@ -389,18 +392,4 @@ private function getLogger()
389
392
}
390
393
return $ this ->logger ;
391
394
}
392
-
393
- /**
394
- * Get serializer
395
- *
396
- * @return SerializerInterface
397
- * @deprecated
398
- */
399
- protected function getSerializer ()
400
- {
401
- if (null === $ this ->serializer ) {
402
- $ this ->serializer = \Magento \Framework \App \ObjectManager::getInstance ()->get (Serialize::class);
403
- }
404
- return $ this ->serializer ;
405
- }
406
395
}
0 commit comments