File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
tests/PHPStan/Rules/PhpDoc Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,15 @@ public function testBug11015(): void
206
206
$ this ->analyse ([__DIR__ . '/data/bug-11015.php ' ], []);
207
207
}
208
208
209
+ public function testBug10861 (): void
210
+ {
211
+ $ this ->checkTypeAgainstNativeType = true ;
212
+ $ this ->checkTypeAgainstPhpDocType = true ;
213
+ $ this ->strictWideningCheck = true ;
214
+
215
+ $ this ->analyse ([__DIR__ . '/data/bug-10861.php ' ], []);
216
+ }
217
+
209
218
public function testEnums (): void
210
219
{
211
220
if (PHP_VERSION_ID < 80100 ) {
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace Bug10861 ;
4
+
5
+ class HelloWorld
6
+ {
7
+ /**
8
+ *
9
+ * @param array<string,mixed> $array1
10
+ * @param-out array<string,mixed> $array1
11
+ */
12
+ public function sayHello (array &$ array1 ): void
13
+ {
14
+ $ values_1 = $ array1 ;
15
+
16
+ $ values_1 = array_filter ($ values_1 , function (mixed $ value ): bool {
17
+ return $ value !== [];
18
+ });
19
+
20
+ /** @var array<string,mixed> $values_1 */
21
+ $ array1 = $ values_1 ;
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments