Merges templates separated by $separator

@param  array  $templates Template objects to merge
@param  string $separator Separator string
@return string
164727
public static function merge(array $templates, $separator = "\n")
    {
        $output = "";

        if (!is_string($separator))
            throw new InvalidArgumentException(
                "Expected string for separator.", 
                1
            );
            
        foreach ($templates as $template) {
            if ($template instanceof TemplateInterface)
                $output .= $template->output() . $separator;
            else
                throw new InvalidArgumentException(
                    "Expected Template objects.", 
                    1
                );
        }
        return $output;
    }
393578
public static function merge(
        string $list1,
        string $list2,
        bool $sort,
        string $separator,
        string $tag = ''
    ): string {
        $items1 = self::explode($separator, $list1);
        $items2 = self::explode($separator, $list2);
        if (count($items2) > 0) {
            foreach ($items2 as $item) {
                if (!in_array($item, $items1)) {
                    $items1[] = $item;
                }
            }
        }
        if ($sort) {
            sort($items1);
        }
        return implode($separator, $items1);
    }
635766
protected function recursiveRender($template)
    {
        $output = '';
        foreach ($template as $val) {
            if (is_array($val)) {
                $output .= $this->recursiveRender($val);
            } else {
                $output .= $val;
            }
        }

        return $output;
    }
971082
protected function combine(array $data, $separator)
    {
        $results = array_shift($data);
        $results = is_array($results) ? $results : [$results];

        while ($value = array_shift($data)) {
            if (is_array($value)) {
                $replacement = [];

                foreach ($value as $array_value) {
                    foreach ($results as $result_value) {
                        $replacement[] = $result_value . $separator . $array_value;
                    }
                }

                $results = $replacement;
            } else {
                foreach ($results as $key => $result_value) {
                    $results[$key] = $result_value . $separator . $value;
                }
            }
        }

        return array_filter($results);
    }
798843
public function setPathSeparator(string $separator)
    {
        if ($this instanceof ParentNodeDefinitionInterface) {
            if (method_exists($this, 'getChildNodeDefinitions')) {
                foreach ($this->getChildNodeDefinitions() as $child) {
                    $child->setPathSeparator($separator);
                }
            } else {
                @trigger_error('Passing a ParentNodeDefinitionInterface without getChildNodeDefinitions() is deprecated since Symfony 4.1.', E_USER_DEPRECATED);
            }
        }

        $this->pathSeparator = $separator;

        return $this;
    }
533646
private function formatAlternatives(array $alternatives, $separator = 'and')
    {
        $format = '"%s"%s';
        if (empty($alternatives)) {
            return 'is empty...';
        }
        $last = array_pop($alternatives);

        return sprintf($format, $alternatives ? implode('", "', $alternatives) : $last, $alternatives ? sprintf(' %s "%s"', $separator, $last) : '');
    }
939166
public static function implode($array, $separator = " > ")
    {
        if ($array === null) {
            return "";
        }

        $elements = [];
        foreach($array as $rawElement) {
            $element = self::sanitizeString($rawElement);

            if ($element !== null) {
                $elements[] = $element;
            }
        }

        return implode($separator, $elements);
    }
477627
public function getJoinedMessage($separator = "\n")
    {
        $messages = $this->getDetailMessages();
        $array = array();
        foreach ($messages as $rules) {
            foreach ($rules as $options) {
                foreach ($options as $message) {
                    $array[] = $message;
                }
            }
        }
        return implode($separator, array_unique($array));
    }
724268
public static String join(final Object array, final String separator) {

    return isArray(array) ? join(toArray(array, ClassUtils.getComponentClass(array)), separator)
      : Objects.toString(array);
  }
661279
public static String join(final Object[] arrays, final String separator) {

        return join(arrays, separator, ELEMENT_CONVERTER);

    }
92277
private function implode($value, $separator = '|'): string
    {
        if (is_string($value)) {
            return $value;
        }

        if (is_array($value) && count($value) === 1) {
            return reset($value);
        }

        return sprintf('(%s)', collect($value)->implode($separator));
    }
431524
public function template($tpl)
    {
        $extlen = strlen($this->tplext);
        if (substr($tpl, -$extlen) !== $this->tplext) {
            $tpl .= $this->tplext;
        }
        return $this->getTplPath() . DIRECTORY_SEPARATOR . $tpl;
    }
55189
public static function removeLast(string $string, string $separator): string
    {
        $string = explode($separator, $string);
        $string = Arr::removeLast($string);
        return implode($separator, $string);
    }
899882
protected function buildRowSeparator(array $columnWidths, string $separator = '-'): string
	{
		$columns = count($columnWidths);

		return str_repeat($separator, array_sum($columnWidths) + (($columns * 4) - ($columns - 1))) . PHP_EOL;
	}
117726
public function templates($templates = null) {

        if ($templates !== null && ! is_string($templates)) {
            $this->_userChangedTemplates = array_merge(array_keys($templates), $this->_userChangedTemplates);
        }

        return parent::templates($templates);
    }
90635
public function getTree(string $separator = '/')
    {
        $tree = '';

        $current = $this;
        do {
            $tree    = $current->getSlug().$separator.$tree;
            $current = $current->getParent();
        } while ($current);

        return trim($tree, $separator);
    }
51089
private function renderTitleFirst($separator)
    {
        $output   = [];
        $output[] = $this->getTitleOnly();

        if ($this->hasSiteName()) {
            $output[] = $separator;
            $output[] = $this->getSiteName();
        }

        return implode('', $output);
    }