Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Reflection/Reflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ private function getParameterTypeFromDocComment(ReflectionParameter $parameter):

$pattern = '/@param(.*)\$' . $parameter->getName() . '\W/';

/** @var list<array{string}> $matches */
preg_match_all($pattern, $docComment, $matches, PREG_SET_ORDER);
/** @var list<list<string>> $matches */
Comment on lines -151 to +152
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$match comes into existence after preg_match_all


if (count($matches) === 0) {
return null;
Expand Down Expand Up @@ -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 {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

convertNamedType does not return ArrayType

/** @psalm-suppress DocblockTypeContradiction https://github.com/vimeo/psalm/issues/9079 */
if ($type instanceof ReflectionIntersectionType) {
$this->throwOnIntersectionType($reflectionParameter);
Expand Down