You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce23f0d
Browse filesBrowse the repository at this point in the historyBrowse files
Narrow native types by conditional expression holders
A holder narrowed only the PHPDoc type of its target, so `$ok = $x !== null;
if ($ok)` left the native type of $x nullable: a later `$x === null` was
reported with the PHPDoc tip in code without PHPDoc, and not at all with
treatPhpDocTypesAsCertain: false.
A matched holder now narrows the native type too when the target and every
guard have native types equal to their PHPDoc types: the PHPDoc knowledge
the holder's type carries is then implied by the native types.
Amp-Thread-ID: https://ampcode.com/threads/T-01a17eac-1199-74a6-b3f7-dfbd8a084465
Copy file name to clipboardExpand all lines: tests/PHPStan/Rules/Classes/ImpossibleInstanceOfRuleTest.php
-2Lines changed: 0 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -411,12 +411,10 @@ public function testBug10201(): void
411
411
412
412
publicfunctiontestBug3632(): void
413
413
{
414
-
$tipText = 'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.';
Copy file name to clipboardExpand all lines: tests/PHPStan/Rules/Comparison/BooleanNotConstantConditionRuleTest.php
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -200,7 +200,6 @@ public function testBug11903(): void
200
200
[
201
201
'Negated boolean expression is always true.',
202
202
13,
203
-
'Because the type is coming from a PHPDoc, you can turn off this check by setting <fg=cyan>treatPhpDocTypesAsCertain: false</> in your <fg=cyan>%configurationFile%</>.',
0 commit comments