Skip to content

Commit 1513b3b

Browse files
committed
Regression test
Closes phpstan/phpstan#5589
1 parent 6fa1285 commit 1513b3b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,4 +510,10 @@ public function testParameterTypeWidening(int $phpVersionId, array $errors): voi
510510
$this->analyse([__DIR__ . '/data/parameter-type-widening.php'], $errors);
511511
}
512512

513+
public function testBug5589(): void
514+
{
515+
$this->phpVersionId = PHP_VERSION_ID;
516+
$this->analyse([__DIR__ . '/data/bug-5589.php'], []);
517+
}
518+
513519
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Bug5589;
4+
5+
/**
6+
* @template-covariant T of object
7+
* @extends \ReflectionClass<T>
8+
*/
9+
class HelloWorld extends \ReflectionClass
10+
{
11+
public static function export($argument, $return = false)
12+
{
13+
return '';
14+
}
15+
}

0 commit comments

Comments
 (0)