diff --git a/src/Reflection/Reflector.php b/src/Reflection/Reflector.php index 4aa5bf2..c43a857 100644 --- a/src/Reflection/Reflector.php +++ b/src/Reflection/Reflector.php @@ -148,8 +148,8 @@ private function getParameterTypeFromDocComment(ReflectionParameter $parameter): $pattern = '/@param(.*)\$' . $parameter->getName() . '\W/'; - /** @var list $matches */ preg_match_all($pattern, $docComment, $matches, PREG_SET_ORDER); + /** @var list> $matches */ if (count($matches) === 0) { return null; @@ -238,7 +238,7 @@ private function getParameterTypeFromReflection(ReflectionType $type, Reflection if ($type instanceof ReflectionUnionType) { return $this->createUnionType( array_map( - function (ReflectionNamedType|ReflectionIntersectionType $type) use ($reflectionParameter): SimpleType|ClassType|EnumType|ArrayType { + function (ReflectionNamedType|ReflectionIntersectionType $type) use ($reflectionParameter): SimpleType|ClassType|EnumType { /** @psalm-suppress DocblockTypeContradiction https://github.com/vimeo/psalm/issues/9079 */ if ($type instanceof ReflectionIntersectionType) { $this->throwOnIntersectionType($reflectionParameter); diff --git a/src/Reflection/Type/SimpleType.php b/src/Reflection/Type/SimpleType.php index e7b5e93..e50676b 100644 --- a/src/Reflection/Type/SimpleType.php +++ b/src/Reflection/Type/SimpleType.php @@ -12,7 +12,7 @@ final class SimpleType implements Stringable { /** - * @psalm-param 'int'|'float'|'string'|'bool'|'true'|'false'|'null'|'array'|'object'|'mixed' $type + * @psalm-param 'int'|'float'|'string'|'bool'|'true'|'false'|'null'|'array'|'object'|'mixed' $name */ public function __construct( public readonly string $name, diff --git a/src/Reflection/TypeTokenizer.php b/src/Reflection/TypeTokenizer.php index 2265d7a..29b835b 100644 --- a/src/Reflection/TypeTokenizer.php +++ b/src/Reflection/TypeTokenizer.php @@ -41,8 +41,8 @@ final class TypeTokenizer */ public static function tokenize(string $type): array { - /** @var list> $matches */ preg_match_all(self::PATTERN, $type, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE); + /** @var list> $matches */ $tokens = [];