Skip to content

Commit 5ca07a2

Browse files
phpstan-botclaude
authored andcommitted
Shorten AlwaysRememberedExpr PHPDoc to be generic about its purpose
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4f2b372 commit 5ca07a2

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

src/Node/Expr/AlwaysRememberedExpr.php

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,7 @@
77
use PHPStan\Node\VirtualNode;
88
use PHPStan\Type\Type;
99

10-
/**
11-
* Wraps an expression so its type is remembered in the scope even when
12-
* `rememberPossiblyImpureFunctionValues` is false.
13-
*
14-
* TypeSpecifier::createForExpr() returns empty SpecifiedTypes for impure
15-
* function calls when that setting is off. Wrapping the call in this node
16-
* bypasses that check (since AlwaysRememberedExpr is not a FuncCall) while
17-
* MutatingScope::specifyExpressionType() propagates the type to the inner
18-
* expression as well.
19-
*
20-
* Used for function calls whose result should always participate in type
21-
* narrowing regardless of purity — e.g. class_exists() guards that gate
22-
* "class not found" errors.
23-
*/
10+
/** Wraps an expression so its type is always remembered in the scope, bypassing impurity checks. */
2411
final class AlwaysRememberedExpr extends Expr implements VirtualNode
2512
{
2613

0 commit comments

Comments
 (0)