Skip to content

Commit

Permalink
Accept questionmark in optional parameter types
Browse files Browse the repository at this point in the history
  • Loading branch information
PrinsFrank committed Sep 7, 2024
1 parent f48ca9b commit 5a42164
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Parameter/ParameterResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function resolve(ReflectionParameter $reflectionParameter, array $params,
}

$valueOptions = [];
foreach (explode('|', $parameterType->__toString()) as $allowedType) {
foreach (explode('|', ltrim($parameterType->__toString(), '?')) as $allowedType) {
foreach ($this->typeResolverProvider->all() as $typeResolverFQN) {
/** @var TypeResolver<mixed> $typeResolver */
$typeResolver = new $typeResolverFQN();
Expand Down

0 comments on commit 5a42164

Please sign in to comment.