We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8dcc4a6 commit af3f105Copy full SHA for af3f105
tests/PHPStan/Type/ClosureTypeFactoryTest.php
@@ -6,6 +6,9 @@
6
use PHPStan\Testing\PHPStanTestCase;
7
use PHPUnit\Framework\Attributes\DataProvider;
8
9
+/**
10
+ * @phpstan-consistent-constructor
11
+ */
12
class ClosureTypeFactoryTest extends PHPStanTestCase
13
{
14
@@ -17,6 +20,14 @@ public static function dataFromClosureObjectReturnType(): array
17
20
[static function () { // @phpcs:ignore
18
21
}, 'mixed'],
19
22
[static fn (): int => 5, 'int'],
23
+ [
24
+ static fn (): self => new self('name'),
25
+ self::class,
26
+ ],
27
28
+ static fn (): static => new static('name'),
29
+ 'static(' . self::class . ')',
30
31
];
32
}
33
0 commit comments