Skip to content

Commit

Permalink
[VarDumper] Fix error when reflected class has default Enum parameter…
Browse files Browse the repository at this point in the history
… in constructor
  • Loading branch information
kapiwko authored and nicolas-grekas committed Feb 23, 2023
1 parent a110fcb commit 6c5ac3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Caster/ReflectionCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ public static function castParameter(\ReflectionParameter $c, array $a, Stub $st
if ($c->isOptional()) {
try {
$a[$prefix.'default'] = $v = $c->getDefaultValue();
if ($c->isDefaultValueConstant()) {
if ($c->isDefaultValueConstant() && !\is_object($v)) {
$a[$prefix.'default'] = new ConstStub($c->getDefaultValueConstantName(), $v);
}
if (null === $v) {
Expand Down

0 comments on commit 6c5ac3a

Please sign in to comment.