Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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 */

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 {
/** @psalm-suppress DocblockTypeContradiction https://github.com/vimeo/psalm/issues/9079 */
if ($type instanceof ReflectionIntersectionType) {
$this->throwOnIntersectionType($reflectionParameter);
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/Type/SimpleType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/Reflection/TypeTokenizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ final class TypeTokenizer
*/
public static function tokenize(string $type): array
{
/** @var list<array<int|string, array{string, int}>> $matches */
preg_match_all(self::PATTERN, $type, $matches, PREG_SET_ORDER | PREG_OFFSET_CAPTURE);
/** @var list<array<int|('namedType'|'symbol'|'whitespace'|'other'), array{string, int}>> $matches */

$tokens = [];

Expand Down