private function excludeSubPaths(array $paths) : array
    {
        if (empty($paths)) {
            return $paths;
        }
        sort($paths);
        $uniquePaths = [$paths[0]];
        for ($i = 1, $count = count($paths); $i < $count; ++$i) {
            $lastUniquePath = end($uniquePaths);
            assert($lastUniquePath !== false);

            if (strpos($paths[$i], $lastUniquePath) === 0) {
                continue;
            }

            $uniquePaths[] = $paths[$i];
        }

        return $uniquePaths;
    }
private function excludeSubPaths(array $paths) : array
    {
        if (empty($paths)) {
            return $paths;
        }
        sort($paths);
        $uniquePaths = [$paths[0]];
        for ($i = 1, $count = count($paths); $i < $count; ++$i) {
            $lastUniquePath = end($uniquePaths);
            assert($lastUniquePath !== false);

            if (strpos($paths[$i], $lastUniquePath) === 0) {
                continue;
            }

            $uniquePaths[] = $paths[$i];
        }

        return $uniquePaths;
    }
private function excludeSubPaths ( array $ paths ) : array { if ( empty ( $ paths ) ) { return $ paths ; } sort ( $ paths ) ; $ uniquePaths = [ $ paths [ 0 ] ] ; for ( $ i = 1 , $ count = count ( $ paths ) ; $ i < $ count ; ++ $ i ) { $ lastUniquePath = end ( $ uniquePaths ) ; assert ( $ lastUniquePath !== false ) ; if ( strpos ( $ paths [ $ i ] , $ lastUniquePath ) === 0 ) { continue ; } $ uniquePaths [ ] = $ paths [ $ i ] ; } return $ uniquePaths ; }
Remove from passed paths list all sub-paths.

@param string[] $paths

@return string[]
Remove from passed paths list all sub - paths .