diff --git a/psalm.xml b/psalm.xml index 74ee297..277e73d 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,7 @@ getType(); if (!$type) { return null; } - /** - * @psalm-suppress UndefinedClass Needed for PHP 8.0 only, because ReflectionIntersectionType is not supported. - */ return new TypeConfig( name: $this->convertTypeToString($type, $param->getDeclaringClass()?->getName()), allowsNull: $type->allowsNull(), @@ -204,32 +198,22 @@ private function getMethodReturnTypeConfig(ReflectionMethod $method): ?TypeConfi { $returnType = $method->getReturnType(); if (!$returnType && method_exists($method, 'getTentativeReturnType')) { - /** - * Needed for PHP 8.0 only, because getTentativeReturnType() is not supported. - * - * @var ReflectionType|null - * @psalm-suppress UnnecessaryVarAnnotation - */ $returnType = $method->getTentativeReturnType(); } + /** + * @var ReflectionIntersectionType|ReflectionNamedType|ReflectionUnionType|null $returnType + */ if (!$returnType) { return null; } - /** - * @psalm-suppress ArgumentTypeCoercion Needed for PHP 8.0 only, because ReflectionIntersectionType is - * not supported. - */ return new TypeConfig( name: $this->convertTypeToString($returnType, $method->getDeclaringClass()->getName()), allowsNull: $returnType->allowsNull(), ); } - /** - * @psalm-suppress UndefinedClass Needed for PHP 8.0 only, because ReflectionIntersectionType is not supported. - */ private function convertTypeToString( ReflectionNamedType|ReflectionUnionType|ReflectionIntersectionType $type, ?string $declaringClassName = null,