Skip to content

Commit 2fb208a

Browse files
committed
[TypeDeclarationDocblocks] Handle with duplicated nested type[] array docblock on DocblockReturnArrayFromDirectArrayInstanceRector
1 parent a340f8c commit 2fb208a

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
namespace Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector\Fixture;
4+
5+
final class WithDuplicatedNestedArray
6+
{
7+
public static function run(): iterable
8+
{
9+
$testingUrls = [
10+
'test',
11+
'test?important_parameter=1',
12+
];
13+
14+
return [
15+
'$cacheQueryString=false' => [false, 1, $testingUrls],
16+
'$cacheQueryString=true' => [true, 5, $testingUrls],
17+
'$cacheQueryString=array' => [['important_parameter'], 3, $testingUrls],
18+
];
19+
}
20+
}
21+
22+
?>
23+
-----
24+
<?php
25+
26+
namespace Rector\Tests\TypeDeclarationDocblocks\Rector\ClassMethod\DocblockReturnArrayFromDirectArrayInstanceRector\Fixture;
27+
28+
final class WithDuplicatedNestedArray
29+
{
30+
/**
31+
* @return array<string, string[][]|bool[]|int[]>
32+
*/
33+
public static function run(): iterable
34+
{
35+
$testingUrls = [
36+
'test',
37+
'test?important_parameter=1',
38+
];
39+
40+
return [
41+
'$cacheQueryString=false' => [false, 1, $testingUrls],
42+
'$cacheQueryString=true' => [true, 5, $testingUrls],
43+
'$cacheQueryString=array' => [['important_parameter'], 3, $testingUrls],
44+
];
45+
}
46+
}
47+
48+
?>

0 commit comments

Comments
 (0)