Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -95,20 +95,19 @@ public function refactor(Node $node): ?Node

private function processIdentical(Identical $identical): ?NotIdentical
{
$leftType = $this->getType($identical->left);
if (! $leftType->isBoolean()->yes()) {
// cheap structural guard first, so getType() runs only on the "!$a === $b" shape
if (! $identical->left instanceof BooleanNot) {
return null;
}

$rightType = $this->getType($identical->right);
if (! $rightType->isBoolean()->yes()) {
if (! $this->getType($identical->left)->isBoolean()->yes()) {
return null;
}

if ($identical->left instanceof BooleanNot) {
return new NotIdentical($identical->left->expr, $identical->right);
if (! $this->getType($identical->right)->isBoolean()->yes()) {
return null;
}

return null;
return new NotIdentical($identical->left->expr, $identical->right);
}
}
Loading