From d1329a87f75ff6b834e657a641e3ead2d1017280 Mon Sep 17 00:00:00 2001 From: Jacob Thomason Date: Wed, 18 Dec 2024 08:16:57 -0500 Subject: [PATCH] Fixed incorrect assertions --- src/Mappers/Parameters/TypeHandler.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Mappers/Parameters/TypeHandler.php b/src/Mappers/Parameters/TypeHandler.php index 393368fa2..cd1a2d6b5 100644 --- a/src/Mappers/Parameters/TypeHandler.php +++ b/src/Mappers/Parameters/TypeHandler.php @@ -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; @@ -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) { @@ -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;