getAttribute(AttributeKey::PARENT_NODE)) { if ($currentNode instanceof Expression) { continue; } if (! $currentNode instanceof Node) { continue; } if ($functionLike === $currentNode) { // to high break; } $nestingHash .= $this->resolveBinaryOpNestingHash($currentNode, $previous); $nestingHash .= spl_object_hash($currentNode); $previous = $currentNode; } return $nestingHash; } private function resolveBinaryOpNestingHash(Node $currentNode, Node $previous): string { if (! $currentNode instanceof BinaryOp) { return ''; } // left && right have differnt nesting if ($currentNode->left === $previous) { return 'binary_left__'; } if ($currentNode->right === $previous) { return 'binary_right__'; } return ''; } }