private function walk($var)
    {
        $output = [];
        foreach ($var as $index => $item) {
            $output[$index] = is_array($item) || $item instanceof Traversable
                ? $this->collect($item)
                : $this->atomic($item);
        }

        return $output;
    }
private function walk($var)
    {
        $output = [];
        foreach ($var as $index => $item) {
            $output[$index] = is_array($item) || $item instanceof Traversable
                ? $this->collect($item)
                : $this->atomic($item);
        }

        return $output;
    }
private function walk ( $ var ) { $ output = [ ] ; foreach ( $ var as $ index => $ item ) { $ output [ $ index ] = is_array ( $ item ) || $ item instanceof Traversable ? $ this -> collect ( $ item ) : $ this -> atomic ( $ item ) ; } return $ output ; }
Function called for traversable items. Methods loops every item and if it is traversable
it is recursively parsed, otherwise it is returned maybe transformed according to settings.

@param  array|Traversable $var
@return array
Function called for traversable items . Methods loops every item and if it is traversable it is recursively parsed otherwise it is returned maybe transformed according to settings .