Skip to content

Commit

Permalink
Fixed incorrect assertions (#723)
Browse files Browse the repository at this point in the history
  • Loading branch information
oojacoboo authored Dec 18, 2024
1 parent fbb20d2 commit 436e69e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Mappers/Parameters/TypeHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function mapReturnType(
$refMethod,
$docBlockObj,
);
assert(! $type instanceof InputType);
assert($type instanceof OutputType);
} catch (CannotMapTypeExceptionInterface $e) {
$e->addReturnInfo($refMethod);
throw $e;
Expand Down Expand Up @@ -160,7 +160,12 @@ private function getDocBlockPropertyType(DocBlock $docBlock, ReflectionProperty
return reset($varTags)->getType();
}

public function mapParameter(ReflectionParameter $parameter, DocBlock $docBlock, Type|null $paramTagType, ParameterAnnotations $parameterAnnotations): ParameterInterface
public function mapParameter(
ReflectionParameter $parameter,
DocBlock $docBlock,
Type|null $paramTagType,
ParameterAnnotations $parameterAnnotations,
): ParameterInterface
{
$hideParameter = $parameterAnnotations->getAnnotationByType(HideParameter::class);
if ($hideParameter) {
Expand Down Expand Up @@ -327,7 +332,7 @@ public function mapInputProperty(
$inputType = $this->typeResolver->mapNameToInputType($inputTypeName);
} else {
$inputType = $this->mapPropertyType($refProperty, $docBlock, true, $argumentName, $isNullable);
assert(! $inputType instanceof OutputType);
assert($inputType instanceof InputType);
}

$hasDefault = $defaultValue !== null || $isNullable;
Expand Down

0 comments on commit 436e69e

Please sign in to comment.