@@ -228,10 +228,6 @@ public function process($serviceClassName, $serviceMethodName, array $inputArray
228
228
private function getConstructorData (string $ className , array $ data ): array
229
229
{
230
230
$ preferenceClass = $ this ->config ->getPreference ($ className );
231
- if (is_subclass_of ($ preferenceClass , \SimpleXMLElement::class)
232
- || is_subclass_of ($ preferenceClass , \DOMElement::class)) {
233
- return [];
234
- }
235
231
$ class = new ClassReflection ($ preferenceClass ?: $ className );
236
232
237
233
try {
@@ -270,7 +266,7 @@ private function getConstructorData(string $className, array $data): array
270
266
*
271
267
* @param string $className
272
268
* @param array $data
273
- * @return object the newly created and populated object
269
+ * @return object|null the newly created and populated object
274
270
* @throws \Exception
275
271
* @throws SerializationException
276
272
* @SuppressWarnings(PHPMD.NPathComplexity)
@@ -282,6 +278,10 @@ protected function _createFromArray($className, $data)
282
278
// convert to string directly to avoid situations when $className is object
283
279
// which implements __toString method like \ReflectionObject
284
280
$ className = (string ) $ className ;
281
+ if (is_subclass_of ($ className , \SimpleXMLElement::class)
282
+ || is_subclass_of ($ className , \DOMElement::class)) {
283
+ return null ;
284
+ }
285
285
$ class = new ClassReflection ($ className );
286
286
if (is_subclass_of ($ className , self ::EXTENSION_ATTRIBUTES_TYPE )) {
287
287
$ className = substr ($ className , 0 , -strlen ('Interface ' ));
0 commit comments