Skip to content

Commit 807e892

Browse files
Add non regression test
1 parent ceff22a commit 807e892

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

tests/PHPStan/Rules/Comparison/WhileLoopAlwaysTrueConditionRuleTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ public function testRulePHP81(): void
5454
$this->analyse([__DIR__ . '/data/while-loop-true-php81.php'], []);
5555
}
5656

57+
public function testBug10054(): void
58+
{
59+
$this->analyse([__DIR__ . '/data/bug-10054.php'], []);
60+
}
61+
5762
public function testBug6189(): void
5863
{
5964
$this->analyse([__DIR__ . '/data/bug-6189.php'], [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace Bug10054;
4+
5+
function falsePositive(): \Generator {
6+
while (true) {
7+
$item = yield;
8+
9+
yield $item;
10+
}
11+
}
12+
13+
$generator = falsePositive();
14+
15+
var_dump($generator->send('foo'));

0 commit comments

Comments
 (0)