Skip to content

Commit 5b67b5e

Browse files
Add 11535 regression test
1 parent 9daae6d commit 5b67b5e

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

tests/PHPStan/Rules/PhpDoc/WrongVariableNameInVarTagRuleTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ public function testBug10861(): void
215215
$this->analyse([__DIR__ . '/data/bug-10861.php'], []);
216216
}
217217

218+
public function testBug11535(): void
219+
{
220+
$this->checkTypeAgainstNativeType = true;
221+
$this->checkTypeAgainstPhpDocType = true;
222+
$this->strictWideningCheck = true;
223+
224+
$this->analyse([__DIR__ . '/data/bug-11535.php'], []);
225+
}
226+
218227
public function testEnums(): void
219228
{
220229
if (PHP_VERSION_ID < 80100) {
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 Bug11535;
4+
5+
/** @var \Closure(string): array<int> */
6+
$a = function(string $b) {
7+
return [1,2,3];
8+
};
9+
10+
/** @var \Closure(array): array */
11+
$a = function(array $b) {
12+
return $b;
13+
};
14+
15+
/** @var \Closure(string): string */
16+
$a = function(string $b) {
17+
return $b;
18+
};

0 commit comments

Comments
 (0)