Skip to content

Commit ad97094

Browse files
Add test
1 parent 36406a9 commit ad97094

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/PHPStan/Rules/PhpDoc/WrongVariableNameInVarTagRuleTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,10 @@ public function testBug12457(): void
521521
'PHPDoc tag @var with type array{numeric-string} is not subtype of type array{lowercase-string&numeric-string&uppercase-string}.',
522522
13,
523523
],
524+
[
525+
'PHPDoc tag @var with type callable(): string is not subtype of type callable(): numeric-string&lowercase-string&uppercase-string.',
526+
22,
527+
],
524528
]);
525529
}
526530

tests/PHPStan/Rules/PhpDoc/data/bug-12457.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,13 @@ public function sayHello(array $a): void
1212
/** @var array{numeric-string} $b */
1313
$b = $a;
1414
}
15+
16+
/**
17+
* @param callable(): numeric-string&uppercase-string&lowercase-string $a
18+
*/
19+
public function sayHello2(callable $a): void
20+
{
21+
/** @var callable(): string $b */
22+
$b = $a;
23+
}
1524
}

0 commit comments

Comments
 (0)