public function traverse(callable $visitor, array $parts = [])
    {
        $parts = $parts ?: array_keys($this->_parts);
        foreach ($parts as $name) {
            $visitor($this->_parts[$name], $name);
        }

        return $this;
    }
public function traverse(callable $visitor, array $parts = [])
    {
        $parts = $parts ?: array_keys($this->_parts);
        foreach ($parts as $name) {
            $visitor($this->_parts[$name], $name);
        }

        return $this;
    }
public function traverse ( callable $ visitor , array $ parts = [ ] ) { $ parts = $ parts ? : array_keys ( $ this -> _parts ) ; foreach ( $ parts as $ name ) { $ visitor ( $ this -> _parts [ $ name ] , $ name ) ; } return $ this ; }
Will iterate over every specified part. Traversing functions can aggregate
results using variables in the closure or instance variables. This function
is commonly used as a way for traversing all query parts that
are going to be used for constructing a query.

The callback will receive 2 parameters, the first one is the value of the query
part that is being iterated and the second the name of such part.

### Example:
```
$query->select(['title'])->from('articles')->traverse(function ($value, $clause) {
if ($clause === 'select') {
var_dump($value);
}
}, ['select', 'from']);
```

@param callable $visitor A function or callable to be executed for each part
@param string[] $parts The query clauses to traverse
@return $this
Will iterate over every specified part . Traversing functions can aggregate results using variables in the closure or instance variables . This function is commonly used as a way for traversing all query parts that are going to be used for constructing a query .