Skip to content

Commit

Permalink
finally green 🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 19, 2024
1 parent 768537f commit b05b6ae
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ReflectionParameter.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\BinaryOp\Concat;
use PhpParser\Node\Expr\ClassConstFetch;
use PhpParser\Node\Expr\ConstFetch;
use PhpParser\Node\Identifier;
use PhpParser\Node\Name;
use PhpParser\Node\NullableType;
Expand Down Expand Up @@ -189,7 +190,12 @@ public function allowsNull(): bool
return true;
}

return !isset($this->parameterNode->type);
if (!isset($this->parameterNode->type)) {
return true;
}

return $this->parameterNode->default instanceof ConstFetch
&& strtolower($this->parameterNode->default->name->toString()) === 'null';
}

/**
Expand Down

0 comments on commit b05b6ae

Please sign in to comment.