@param array $items
@param array $attrs

@return string
438159
public function getTabs(array $items, array $attrs = []): string
    {
        $attrs = HtmlAttrs::build(array_replace_recursive([
            'role' => 'tablist',
            'class' => 'nav nav-tabs',
        ], $attrs));

        return vsprintf('<ul %s>%s</ul>', [
            $attrs,
            implode('', array_map([$this, 'getTab'], $items)),
        ]);
    }
1286313
public static function toResults(array $items) {

        $output = [];

        foreach ($items as $current) {

            if (false === ($current instanceof Select2ItemInterface)) {
                throw new InvalidArgumentException("The item must implements Select2ItemInterface");
            }

            $output[] = [
                "id"   => $current->getSelect2ItemId(),
                "text" => $current->getSelect2ItemText(),
            ];
        }

        return $output;
    }
771707
public function attributable(array $attributes, array $defaults = []): string
    {
        return $this->attributes($this->decorate($attributes, $defaults));
    }
409169
private function createCheckboxNode(array $attrs)
    {
        $defaults = array(
            'type' => 'checkbox',
            'value' => '1'
        );

        $attrs = array_merge($defaults, $attrs);

        $node = new NodeElement();
        $node->openTag('input')
             ->addAttributes($attrs);

        // Check if active
        if ($this->active == $defaults['value'] || $this->active === true) {
            $node->addProperty('checked');
        }

        $node->finalize(true);

        return $node;
    }
523115
public static function parseAttrsString($attrs,$excludeAttrs = array())
	{
		$result = '';
		if(is_array($attrs))
		{
			if(isset($attrs['disabled']) && 0==$attrs['disabled'])
			{
				unset($attrs['disabled']);
			}
			if(isset($attrs['readonly']) && 0==$attrs['readonly'])
			{
				unset($attrs['readonly']);
			}
			foreach($attrs as $key=>$attr)
			{
				if(false===in_array($key,$excludeAttrs))
				{
					$result .= " {$key}=\"{$attr}\"";
				}
			}
		}
		return $result;
	}
1240095
protected function setCommentAttribute($items)
    {
        if (is_array($items) === false) {
            return $items;
        }

        return array_map(function ($item) {
            return $this->getNestedContext(Comment::class, $item);
        }, $items);
    }
164017
protected function getItems(array $items)
	{
		$result = array();
		foreach($items as $item) {
			$result[] = $this->getItem($item);
		}
		return $result;
	}
203568
private function escapeAttributes($attrs)
    {
        $script = '[';
        $first = true;
        foreach ($attrs as $name => $value) {
            if ($first) {
                $first = false;
            } else {
                $script .= ' ';
            }
            $script .= $name . '=' . self::escape($value);
        }
        $script .= ']';

        return $script;
    }
1180958
public function getDescriptionValue(array $items): string
    {
        $description = '';

        foreach ($items as $item) {
            $description .= 'Name:' . $item->getName();
            $description .= static::ATTRIBUTES_SEPARATOR . 'Sku:' . $item->getSku();
            $description .= static::ATTRIBUTES_SEPARATOR . 'Quantity:' . $item->getQuantity();
            $description .= static::ITEMS_SEPARATOR;
        }

        return $description;
    }
591148
protected function setAuthorAttribute($items)
    {
        if (is_array($items) === false) {
            return $items;
        }

        return array_map(function ($item) {
            return $this->getNestedContext(Person::class, $item);
        }, $items);
    }
243816
private static function result($items)
    {
        if ($items instanceof SuggestResult) {
            return $items->toArray();
        }

        $sr = new SuggestResult($items);

        return $sr->toArray();
    }
64893
private function parseArrayToCatalogFieldEntities(array $items)
    {
        $entities = [];
        foreach ($items as $elementType => $catalogItems) {
            $entities = array_merge($entities, $this->parseArrayToFieldEntities($catalogItems, $elementType));
        }
        return $entities;
    }
465480
protected function prepareTableRows($items) {
        $tableRows = [];
        foreach ($items as $key => $value) {
            if (is_object($value) && method_exists($value, '__toString')) {
                $value = (string) $value;
            } elseif (is_array($value) || is_object($value)) {
                $value = Yaml::dump($value);
            } elseif (is_bool($value)) {
                $value = ($value) ? 'TRUE' : 'FALSE';
            }
            $tableRows[] = [$key, $value];
        }
        return $tableRows;
    }
308575
protected function _mergeAttr(array $attrs = array(), $val = null, $key = 'class')
    {
        if (Arr::key($key, $attrs)) {
            $attrs[$key] .= ' ' . $val;
        } else {
            $attrs[$key] = $val;
        }
        return $attrs;
    }
627618
public function attr(array $attributes)
    {
        $result = '';

        foreach ($attributes as $attribute => $value) {
            $result .= ' '.(is_int($attribute) ? $value : $attribute.'="'.str_replace('"', '&quot;', $value).'"');
        }

        return $result;
    }
731954
protected function _formatAttributes(array $attributes, ItemInterface $item)
    {
        if (!empty($attributes)) {
            return $this->templater()->formatAttributes(
                $attributes + ['escape' => $item->getExtra('escape', true)]
            );
        }

        return '';
    }
508587
protected function varStartHandler(array $attrs): void
    {
        if (preg_match('/^I18N::number\((.+)\)$/', $attrs['var'], $match)) {
            $this->text .= I18N::number((int) $match[1]);
        } elseif (preg_match('/^I18N::translate\(\'(.+)\'\)$/', $attrs['var'], $match)) {
            $this->text .= I18N::translate($match[1]);
        } elseif (preg_match('/^I18N::translateContext\(\'(.+)\', *\'(.+)\'\)$/', $attrs['var'], $match)) {
            $this->text .= I18N::translateContext($match[1], $match[2]);
        } else {
            $this->text .= $attrs['var'];
        }
    }