File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
tests/PHPStan/Rules/PhpDoc Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,15 @@ public function testBug12458(): void
197
197
$ this ->analyse ([__DIR__ . '/data/bug-12458.php ' ], []);
198
198
}
199
199
200
+ public function testBug11015 (): void
201
+ {
202
+ $ this ->checkTypeAgainstNativeType = true ;
203
+ $ this ->checkTypeAgainstPhpDocType = true ;
204
+ $ this ->strictWideningCheck = true ;
205
+
206
+ $ this ->analyse ([__DIR__ . '/data/bug-11015.php ' ], []);
207
+ }
208
+
200
209
public function testEnums (): void
201
210
{
202
211
if (PHP_VERSION_ID < 80100 ) {
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types = 1 );
2
+
3
+ namespace Bug11015 ;
4
+
5
+ class HelloWorld
6
+ {
7
+ public function sayHello (PDOStatement $ date ): void
8
+ {
9
+ $ b = $ date ->fetch ();
10
+ if (empty ($ b )) {
11
+ return ;
12
+ }
13
+
14
+ /** @var array<string, int> $b */
15
+ echo $ b ['a ' ];
16
+ }
17
+
18
+ public function sayHello2 (PDOStatement $ date ): void
19
+ {
20
+ $ b = $ date ->fetch ();
21
+
22
+ /** @var array<string, int> $b */
23
+ echo $ b ['a ' ];
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments