HierarchicalCachePoolTrait.php
private function explodeKey($string)
    {
        list($key, $tag) = explode(AbstractCachePool::SEPARATOR_TAG, $string.AbstractCachePool::SEPARATOR_TAG);

        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.AbstractCachePool::SEPARATOR_TAG.$tag;
        }, $parts);
    }
private function explodeKey($string)
    {
        list($key, $tag) = explode(AbstractCachePool::SEPARATOR_TAG, $string.AbstractCachePool::SEPARATOR_TAG);

        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.AbstractCachePool::SEPARATOR_TAG.$tag;
        }, $parts);
    }
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"].

@param string $string

@return array