Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 1, 2025

as discussed in #4595 (review)

see

} elseif ($expr instanceof Expr\Cast\Bool_) {
return $this->specifyTypesInCondition(
$scope,
new Node\Expr\BinaryOp\Equal($expr->expr, new ConstFetch(new Name\FullyQualified('true'))),
$context,
)->setRootExpr($expr);
} elseif ($expr instanceof Expr\Cast\String_) {
return $this->specifyTypesInCondition(
$scope,
new Node\Expr\BinaryOp\NotEqual($expr->expr, new Node\Scalar\String_('')),
$context,
)->setRootExpr($expr);
} elseif ($expr instanceof Expr\Cast\Int_) {
return $this->specifyTypesInCondition(
$scope,
new Node\Expr\BinaryOp\NotEqual($expr->expr, new Node\Scalar\LNumber(0)),
$context,
)->setRootExpr($expr);
} elseif ($expr instanceof Expr\Cast\Double) {
return $this->specifyTypesInCondition(
$scope,
new Node\Expr\BinaryOp\NotEqual($expr->expr, new Node\Scalar\DNumber(0.0)),
$context,
)->setRootExpr($expr);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant