protected function _stringableJoin($parts, $delim)
    {
        $parts  = $this->_normalizeIterable($parts);
        $i      = 0;
        $result = '';
        foreach ($parts as $_part) {
            try {
                $_part = $this->_normalizeString($_part);
            } catch (InvalidArgumentException $e) {
                throw $this->_createOutOfRangeException($this->__('Invalid string part'), null, $e, $_part);
            }

            if ($i) {
                $result .= $delim;
            }

            $result .= $_part;
            ++$i;
        };

        return $result;
    }
protected function _stringableJoin($parts, $delim)
    {
        $parts  = $this->_normalizeIterable($parts);
        $i      = 0;
        $result = '';
        foreach ($parts as $_part) {
            try {
                $_part = $this->_normalizeString($_part);
            } catch (InvalidArgumentException $e) {
                throw $this->_createOutOfRangeException($this->__('Invalid string part'), null, $e, $_part);
            }

            if ($i) {
                $result .= $delim;
            }

            $result .= $_part;
            ++$i;
        };

        return $result;
    }
protected function _stringableJoin ( $ parts , $ delim ) { $ parts = $ this -> _normalizeIterable ( $ parts ) ; $ i = 0 ; $ result = '' ; foreach ( $ parts as $ _part ) { try { $ _part = $ this -> _normalizeString ( $ _part ) ; } catch ( InvalidArgumentException $ e ) { throw $ this -> _createOutOfRangeException ( $ this -> __ ( 'Invalid string part' ) , null , $ e , $ _part ) ; } if ( $ i ) { $ result .= $ delim ; } $ result .= $ _part ; ++ $ i ; } ; return $ result ; }
Joins a list of parts using a delimiter.

@param array|stdClass|Traversable $parts The list of parts to join.
@param string|Stringable          $delim The delimiter to use for joining.

@throws InvalidArgumentException If the list of parts or the delimiter is invalid.
@throws OutOfRangeException      If one of the parts or the delimiter cannot be normalized to string.

@return string A string consisting of parts joined by delimiter.
Joins a list of parts using a delimiter .