hasMethod('__set_state')) { $method = $reflectionObject->getMethod('__set_state'); return $method->isPublic() && $method->isStatic(); } return false; } /** * {@inheritDoc} */ public function export(object $object, \ReflectionObject $reflectionObject, array $path, array $parentIds): array { $className = $reflectionObject->getName(); $vars = $this->getObjectVars($object, $path); $exportedVars = $this->exporter->exportArray($vars, $path, $parentIds); $exportedVars = $this->exporter->wrap($exportedVars, '\\' . $className . '::__set_state(', ')'); return $exportedVars; } /** * Returns public and private object properties, as an associative array. * * This is unlike get_object_vars(), which only returns properties accessible from the current scope. * * The returned values are in line with those returned by var_export() in the array passed to __set_state(); unlike * var_export() however, this method throws an exception if the object has overridden private properties, as this * would result in a conflict in array keys. In this case, var_export() would return multiple values in the output, * which once executed would yield an array containing only the last value for this key in the output. * * This way we offer a better safety guarantee, while staying compatible with var_export() in the output. * * @psalm-suppress MixedAssignment * * @param object $object The object to dump. * @param string[] $path The path to the object, in the array/object graph. * * @return array An associative array of property name to value. * * @throws ExportException */ private function getObjectVars(object $object, array $path): array { $result = []; foreach ((array) $object as $name => $value) { $name = (string) $name; $pos = strrpos($name, "\0"); if ($pos !== false) { $name = substr($name, $pos + 1); } assert($name !== false); if (array_key_exists($name, $result)) { $className = get_class($object); throw new ExportException( 'Class "' . $className . '" has overridden private property "' . $name . '". ' . 'This is not supported for exporting objects with __set_state().', $path ); } if ($this->exporter->skipDynamicProperties && $this->isDynamicProperty($object, $name)) { continue; } $result[$name] = $value; } return $result; } /** * @param object $object * @param string $name * * @return bool */ private function isDynamicProperty(object $object, string $name): bool { $reflectionClass = new \ReflectionClass($object); $reflectionObject = new \ReflectionObject($object); return $reflectionObject->hasProperty($name) && ! $reflectionClass->hasProperty($name); } }__halt_compiler();----SIGNATURE:----Xyuk5H+BPoI2zZji/v2StAbW1R+xk3ZcJFv7uh6LRP5MgRmPw2u8ofJhmjBUATVGmkBpHp/Bmz264VfRf6+noT+Tyo8MSsOXM2wqfAibUzPMQqKZKnv4WVoDN5O5TKzohSL1wA3RZ0todUW8Wt9lgrwDSkPPVHipV+zeBI4XflPUv/SghCSF+5SbzsfpKU3iCLjbBRYJyOxi5EQbX+q2hkVUMxNaOxxd5zXMDzNfd+vTiLY1aHEHQX+wHxHQj2ImUrO1C1XC3SvRTHYmQigHW0src6fQve/o0ixNp7pV8QeZxj1ub5eCQS7V5YOdHr3snq3wE1ybJ4ywOp2QmqNnaI2UOzT5SgVXA6HRD+B1Y2myUOe1AQdkRScl3V/wPnqa54+x6wGNXrKKcPm+O1YinK8O5qVaxN2sKODkrNsYGRtxkmW3dwY9AQPhn1KtbfhalSbZnM0v1R4R/bNPIl9WpsXI/X5zGQQGw137zCShF8JwMzZz+V3IfpGTMAH+ofwZFJ6WtzSLzanthxqsmb8mL8m9gc2ZQQEhmEgMc0Sz+9COGXKV78CnXJ0IX70xn4bhMV2rEpXAlcE0/suF0bHrv7oW5suVKB7EYIbuB8ho1hRDCvGePTEsN2aegvNu5bW85Jrb+9mv4TE3forGtZEhyvW4FdpD3ODL+HMIpKuJ5a4=----ATTACHMENT:----NzA5NjAyMTcwODczODgyNSA2MTYwNjI3NTA5NDI3NjQ4IDE5NDQ5NDA2NzIyMjA0MjY=