Skip to content

Commit

Permalink
Regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Dec 15, 2022
1 parent cb9761e commit f35ea3a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/PHPStan/Analyser/NodeScopeResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,7 @@ public function dataFileAsserts(): iterable
yield from $this->gatherAssertTypes(__DIR__ . '/data/PDOStatement.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/discussion-8447.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-7805.php');
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-82.php');
}

/**
Expand Down
23 changes: 23 additions & 0 deletions tests/PHPStan/Analyser/data/bug-82.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Bug82;

use PHPStan\TrinaryLogic;
use function PHPStan\Testing\assertType;
use function PHPStan\Testing\assertVariableCertainty;

class Response
{

function test()
{
for ($retryCount = 0; $retryCount <= 64; ++$retryCount) {
$response = new Response();
break;
}

assertType(self::class, $response);
assertVariableCertainty(TrinaryLogic::createYes(), $response);
}

}

0 comments on commit f35ea3a

Please sign in to comment.