Skip to content

Commit

Permalink
Handle uppercased types
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Feb 1, 2024
1 parent d4d20fd commit ea0a447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Fixer/Phpdoc/PhpdocListTypeFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ public function getPriority(): int

protected function normalize(string $type): string
{
return Preg::replace('/array(?=<[^,]+(>|<|{|\\())/', 'list', $type);
return Preg::replace('/array(?=<[^,]+(>|<|{|\\())/i', 'list', $type);
}
}
5 changes: 5 additions & 0 deletions tests/Fixer/Phpdoc/PhpdocListTypeFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public static function provideFixCases(): iterable
'<?php /** @var array<Foo> */',
];

yield [
'<?php /** @var list<Foo> */',
'<?php /** @var ARRAY<Foo> */',
];

yield [
'<?php /** @var ?list<Foo> */',
'<?php /** @var ?array<Foo> */',
Expand Down

0 comments on commit ea0a447

Please sign in to comment.