From f5703e5feb5896accada3291cc68c358c5279392 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sat, 1 Oct 2016 18:19:11 +0100 Subject: [PATCH] [VarDumper] Fix merge --- .../Component/VarDumper/Caster/ReflectionCaster.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php index 4ad9872cd3..3343cc18ce 100644 --- a/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php +++ b/src/Symfony/Component/VarDumper/Caster/ReflectionCaster.php @@ -157,8 +157,8 @@ class ReflectionCaster )); if (isset($a[$prefix.'returnType'])) { - $v = (string) $a[$prefix.'returnType']; - $a[$prefix.'returnType'] = new ClassStub($v, array(class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '')); + $v = method_exists('ReflectionType', 'getName') ? $a[$prefix.'returnType']->getName() : $a[$prefix.'returnType']->__toString(); + $a[$prefix.'returnType'] = new ClassStub(($a[$prefix.'returnType']->allowsNull() ? '?' : '').$v, array(class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '')); } if (isset($a[$prefix.'class'])) { $a[$prefix.'class'] = new ClassStub($a[$prefix.'class']); @@ -240,8 +240,7 @@ class ReflectionCaster if (isset($a[$prefix.'typeHint'])) { $v = $a[$prefix.'typeHint']; $a[$prefix.'typeHint'] = new ClassStub($v, array(class_exists($v, false) || interface_exists($v, false) || trait_exists($v, false) ? $v : '', '')); - } - if (!isset($a[$prefix.'typeHint'])) { + } else { unset($a[$prefix.'allowsNull']); }