summaryrefslogtreecommitdiff
path: root/vendor/symfony/var-exporter/Internal/Registry.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/var-exporter/Internal/Registry.php')
-rw-r--r--vendor/symfony/var-exporter/Internal/Registry.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/vendor/symfony/var-exporter/Internal/Registry.php b/vendor/symfony/var-exporter/Internal/Registry.php
index 487a8566e2..705722650a 100644
--- a/vendor/symfony/var-exporter/Internal/Registry.php
+++ b/vendor/symfony/var-exporter/Internal/Registry.php
@@ -93,15 +93,9 @@ class Registry
throw new NotInstantiableTypeException($class);
}
}
- if (null !== $proto && !$proto instanceof \Throwable) {
+ if (null !== $proto && !$proto instanceof \Throwable && !$proto instanceof \Serializable && !\method_exists($class, '__sleep')) {
try {
- if (!$proto instanceof \Serializable && !\method_exists($class, '__sleep')) {
- serialize($proto);
- } elseif ($instantiableWithoutConstructor) {
- serialize($reflector->newInstanceWithoutConstructor());
- } else {
- serialize(unserialize(($proto instanceof \Serializable ? 'C:' : 'O:').\strlen($class).':"'.$class.'":0:{}'));
- }
+ serialize($proto);
} catch (\Exception $e) {
throw new NotInstantiableTypeException($class, $e);
}