hasMethod('__serialize') && $reflectionObject->hasMethod('__unserialize'); } /** * {@inheritDoc} */ public function export(object $object, \ReflectionObject $reflectionObject, array $path, array $parentIds) : array { $lines = $this->getCreateObjectCode($reflectionObject); $lines[] = ''; /** * @psalm-suppress MixedAssignment * @psalm-suppress MixedMethodCall */ $values = $object->__serialize(); $exportedValues = $this->exporter->export($values, $path, $parentIds); $exportedValues = $this->exporter->wrap($exportedValues, '$object->__unserialize(', ');'); $lines = array_merge($lines, $exportedValues); $lines[] = ''; $lines[] = 'return $object;'; return $this->wrapInClosure($lines); } }