Skip to content

Commit 436e69e

Browse files
authored
Fixed incorrect assertions (#723)
1 parent fbb20d2 commit 436e69e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Mappers/Parameters/TypeHandler.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function mapReturnType(
9696
$refMethod,
9797
$docBlockObj,
9898
);
99-
assert(! $type instanceof InputType);
99+
assert($type instanceof OutputType);
100100
} catch (CannotMapTypeExceptionInterface $e) {
101101
$e->addReturnInfo($refMethod);
102102
throw $e;
@@ -160,7 +160,12 @@ private function getDocBlockPropertyType(DocBlock $docBlock, ReflectionProperty
160160
return reset($varTags)->getType();
161161
}
162162

163-
public function mapParameter(ReflectionParameter $parameter, DocBlock $docBlock, Type|null $paramTagType, ParameterAnnotations $parameterAnnotations): ParameterInterface
163+
public function mapParameter(
164+
ReflectionParameter $parameter,
165+
DocBlock $docBlock,
166+
Type|null $paramTagType,
167+
ParameterAnnotations $parameterAnnotations,
168+
): ParameterInterface
164169
{
165170
$hideParameter = $parameterAnnotations->getAnnotationByType(HideParameter::class);
166171
if ($hideParameter) {
@@ -327,7 +332,7 @@ public function mapInputProperty(
327332
$inputType = $this->typeResolver->mapNameToInputType($inputTypeName);
328333
} else {
329334
$inputType = $this->mapPropertyType($refProperty, $docBlock, true, $argumentName, $isNullable);
330-
assert(! $inputType instanceof OutputType);
335+
assert($inputType instanceof InputType);
331336
}
332337

333338
$hasDefault = $defaultValue !== null || $isNullable;

0 commit comments

Comments
 (0)