Skip to content

Commit bf8e307

Browse files
jlherrenondrejmirtes
authored andcommitted
Add regression test for #577
1 parent fb84c11 commit bf8e307

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/PHPStan/Rules/Methods/CallStaticMethodsRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,4 +397,10 @@ public function testNamedArguments(): void
397397
]);
398398
}
399399

400+
public function testBug577(): void
401+
{
402+
$this->checkThisOnly = false;
403+
$this->analyse([__DIR__ . '/data/bug-577.php'], []);
404+
}
405+
400406
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php declare(strict_types = 1);
2+
3+
namespace Bug577;
4+
5+
class Test
6+
{
7+
public static function step1(?int $foo): void
8+
{
9+
if ($foo > 1) {
10+
static::step2($foo);
11+
}
12+
}
13+
14+
public static function step2(int $bar): void
15+
{
16+
var_dump($bar);
17+
}
18+
}

0 commit comments

Comments
 (0)