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:----e7EiejDlqATOJAZCgWgkxrY2F3qGAbTTjn/Jq88mgBIcIUDeqBj9sOJYxUJsAZJY0zk7G/RdmThYRmOwcoN2LECMKAyeZ7Oa/Ev0iTbYhiltZYtEIWGP/uSQLU6pEC04LaswNSkbByKIwgJCFpJ72R0rlEcZNV924jTfYoGhpDLLeaYc6bqp4D+DKcI8V5IRyHsVvxuQOfihrX6K2waurLn93aNtaOhRdtY9KK8PgselqegW9kWSW22lBQmY4YJYTlw1/Va72SdWgguUJk8NY/dgPRv906oYh8wntJWn5Gmj3z+Ao763tkMI9l4/zmLmaPf8FF2/pInFbYFhEUTjCrRlKsdYlZDPgtYZtdmaoOW00I+LL7n7dhVJucA0tGB+XuuDzYhedx0ud/sEcu8AnlZTRvVK0U1g+HZWV/hWjz1ddnrLVkPspt9Yp5lN9U3PuatwkcJwkmPFwMFsWbknx8/dmAarM7Stv4I847SvbjnObZLyskh+aLoL+Gd9QdtfiqiZZy/xVBV8Xrre41aSux/wYWG8lbPzkMPx4IDhe5lYM60riQ/WVE026xjXqYTyXrPTu/e8Jw9Vhd78NgBoxWakdDikRZCPfcAOxsPOCjcFus21RDVDSk8GZxhBrdNPrmV56+ea7ip7xDcIfEhVEW+nr0IQ3gL3CSDRmfkhnEk=----ATTACHMENT:----NTA3MDYzOTI0NzE4ODY3OCA4Nzk3NjUxMzMyNTExMTI5IDY5MzA2MDcyMjU5MDg1NTE=