Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ parameters:
-
rawMessage: Casting to string something that's already string.
identifier: cast.useless
count: 2
count: 1
path: src/Analyser/MutatingScope.php

-
Expand Down
2 changes: 1 addition & 1 deletion src/Analyser/ConditionalExpressionHolderRecipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* composed. The state-dependent math - the condition complements against the
* current type, the holder target types, the vacuity checks - runs in
* evaluate() against the scope the narrowing is applied to
* (MutatingScope::filterBySpecifiedTypes()), never the scope the composition ran
* (MutatingScope::applySpecifiedTypes()), never the scope the composition ran
* on.
*/
final class ConditionalExpressionHolderRecipe
Expand Down
4 changes: 2 additions & 2 deletions src/Analyser/ExprHandler/AssignHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -877,8 +877,8 @@ public function applyWrite(
$condScope = $nodeScopeResolver->processExprNode($stmt, $assignedExpr->cond, $scope, $storage->duplicate(), new NoopNodeCallback(), ExpressionContext::createDeep())->getScope();
$truthySpecifiedTypes = $this->typeSpecifier->specifyTypesInCondition($condScope, $assignedExpr->cond, TypeSpecifierContext::createTruthy());
$falseySpecifiedTypes = $this->typeSpecifier->specifyTypesInCondition($condScope, $assignedExpr->cond, TypeSpecifierContext::createFalsey());
$truthyScope = $condScope->filterBySpecifiedTypes($truthySpecifiedTypes);
$falsyScope = $condScope->filterBySpecifiedTypes($falseySpecifiedTypes);
$truthyScope = $condScope->applySpecifiedTypes($truthySpecifiedTypes);
$falsyScope = $condScope->applySpecifiedTypes($falseySpecifiedTypes);
$truthyType = $truthyScope->getType($if);
$falseyType = $falsyScope->getType($assignedExpr->else);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(
* Captures the either-branch union recovery as a deferred augment: the
* branch types are read from the operand-walk filtered scopes here at
* compose time, while the does-it-actually-narrow gates run against the
* applying scope when MutatingScope::filterBySpecifiedTypes() evaluates it.
* applying scope when MutatingScope::applySpecifiedTypes() evaluates it.
*
* The filtered scopes are thunks resolved only when there are candidate
* expressions - deriving them per level of a deep boolean chain is
Expand Down Expand Up @@ -111,7 +111,7 @@ public function buildBranchUnionAugment(
/**
* Captures the raw entries of a boolean-decomposition holder pair as a
* recipe; the state-dependent complement/target math runs against the
* applying scope when MutatingScope::filterBySpecifiedTypes() evaluates it.
* applying scope when MutatingScope::applySpecifiedTypes() evaluates it.
*
* The condition side asserts that its sub-expression evaluates truthy.
* When that sub-expression is itself a compound boolean (e.g. `$a && $b`),
Expand Down
Loading
Loading