Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Reuse nsrt/bug-6822.php for rule test instead of separate data file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
  • Loading branch information
phpstan-bot and claude committed Mar 30, 2026
commit a811e244ec7915c7ba64eeaab139aba067efa309
8 changes: 8 additions & 0 deletions tests/PHPStan/Analyser/nsrt/bug-6822.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@

if ($closure()) {
assertType('bool', $closure());

if ($closure()) { // should not be reported as "always true"
echo 'yes';
}
}

// Same with an explicit impure closure assigned to a variable
Expand All @@ -25,4 +29,8 @@

if ($impureFn() > 50) {
assertType('int<0, 100>', $impureFn());

if ($impureFn() > 50) { // should not be reported as "always true"
echo 'yes';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function testBug4284(): void
public function testBug6822(): void
{
$this->treatPhpDocTypesAsCertain = true;
$this->analyse([__DIR__ . '/data/bug-6822.php'], []);
$this->analyse([__DIR__ . '/../../Analyser/nsrt/bug-6822.php'], []);
}

}
25 changes: 0 additions & 25 deletions tests/PHPStan/Rules/Comparison/data/bug-6822.php

This file was deleted.

Loading