File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77use PHPStan \Node \VirtualNode ;
88use 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. */
2411final class AlwaysRememberedExpr extends Expr implements VirtualNode
2512{
2613
You can’t perform that action at this time.
0 commit comments