Cache\Hierarchy\HierarchicalCachePoolTrait::explodeKey PHP Метод

explodeKey() приватный Метод

This will take a hierarchy key ("|foo|bar") with tags ("|foo|bar!tagHash") and return an array with each level in the hierarchy appended with the tags. ["foo!tagHash", "bar!tagHash"].
private explodeKey ( $string ) : array
Результат array
    private function explodeKey($string)
    {
        list($key, $tag) = explode(TaggablePoolInterface::TAG_SEPARATOR, $string . TaggablePoolInterface::TAG_SEPARATOR);
        if ($key === HierarchicalPoolInterface::HIERARCHY_SEPARATOR) {
            $parts = ['root'];
        } else {
            $parts = explode(HierarchicalPoolInterface::HIERARCHY_SEPARATOR, $key);
            // remove first element since it is always empty and replace it with 'root'
            $parts[0] = 'root';
        }
        return array_map(function ($level) use($tag) {
            return $level . TaggablePoolInterface::TAG_SEPARATOR . $tag;
        }, $parts);
    }