Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Oct 2, 2023
1 parent 135a394 commit 4dd0f2b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/SourceLocator/SourceStubber/ReflectionSourceStubber.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Roave\BetterReflection\SourceLocator\SourceStubber;

use BackedEnum;
use LogicException;
use PhpParser\Builder\Class_;
use PhpParser\Builder\ClassConst;
Expand Down Expand Up @@ -586,7 +585,7 @@ private function setParameterDefaultValue(ReflectionParameter $parameterReflecti
if (is_object($defaultValue)) {
$className = get_class($defaultValue);
$isEnum = function_exists('enum_exists') && \enum_exists($className, false);
if ($isEnum && $defaultValue instanceof BackedEnum) {
if ($isEnum) {
$parameterNode->setDefault(new Node\Expr\ClassConstFetch(
new FullyQualified($className),
new Node\Identifier($defaultValue->name)
Expand Down

0 comments on commit 4dd0f2b

Please sign in to comment.