protected function filterPaths($prefix, $delimiter, $reducedBlobs)
    {
        $return = [];
        foreach ($reducedBlobs as $reduction) {
            //Skip over self-same directory listings
            if ($reduction['name'] == $prefix) {
                continue;
            } else if ($delimiter == '/') {
                // How many levels in path
                $pathCnt = count(explode('/', $reduction['path']));
                // How many levels in prefix
                $prefixCnt = count(explode('/', $prefix));
                // Directories only listing - To allow one level deeper than prefix.
                if ($prefixCnt + 1 == $pathCnt && ('/' == substr($reduction['path'], -1))) {
                    $return[] = $reduction;
                } elseif ($prefixCnt == $pathCnt) {
                    // Grabs only the files within the path
                    $return[] = $reduction;
                }
            } else {
                $return[] = $reduction;
            }
        }

        return $return;
    }
protected function filterPaths($prefix, $delimiter, $reducedBlobs)
    {
        $return = [];
        foreach ($reducedBlobs as $reduction) {
            //Skip over self-same directory listings
            if ($reduction['name'] == $prefix) {
                continue;
            } else if ($delimiter == '/') {
                // How many levels in path
                $pathCnt = count(explode('/', $reduction['path']));
                // How many levels in prefix
                $prefixCnt = count(explode('/', $prefix));
                // Directories only listing - To allow one level deeper than prefix.
                if ($prefixCnt + 1 == $pathCnt && ('/' == substr($reduction['path'], -1))) {
                    $return[] = $reduction;
                } elseif ($prefixCnt == $pathCnt) {
                    // Grabs only the files within the path
                    $return[] = $reduction;
                }
            } else {
                $return[] = $reduction;
            }
        }

        return $return;
    }
protected function filterPaths ( $ prefix , $ delimiter , $ reducedBlobs ) { $ return = [ ] ; foreach ( $ reducedBlobs as $ reduction ) { //Skip over self-same directory listings if ( $ reduction [ 'name' ] == $ prefix ) { continue ; } else if ( $ delimiter == '/' ) { // How many levels in path $ pathCnt = count ( explode ( '/' , $ reduction [ 'path' ] ) ) ; // How many levels in prefix $ prefixCnt = count ( explode ( '/' , $ prefix ) ) ; // Directories only listing - To allow one level deeper than prefix. if ( $ prefixCnt + 1 == $ pathCnt && ( '/' == substr ( $ reduction [ 'path' ] , - 1 ) ) ) { $ return [ ] = $ reduction ; } elseif ( $ prefixCnt == $ pathCnt ) { // Grabs only the files within the path $ return [ ] = $ reduction ; } } else { $ return [ ] = $ reduction ; } } return $ return ; }
Takes reduced records and filters out subs if delimeter is present indicating full_path = false

@param $prefix       string path to start from
@param $delimiter    string directory delimeter
@param $reducedBlobs array reduced by starting prefix records

@return array filtered records
Takes reduced records and filters out subs if delimeter is present indicating full_path = false