This method filters subpaths of paths already existing in $rawExcludePaths

@param string[] $rawExcludePaths

@return string[]
509416
private function deDupePaths(array $rawExcludePaths)
    {
        $filteredArray = $rawExcludePaths;
        $count = count($filteredArray);
        for ($i = 0; $count > $i; $i++) {
            if (!isset($filteredArray[$i])) {
                continue;
            }
            $item = $filteredArray[$i];
            $filteredArray = array_filter(
                $filteredArray,
                function ($value) use ($item) {
                    return !(strlen($value) !== strlen($item) && strpos($value, $item) === 0);
                }
            );
        }
        $filteredArray = array_values($filteredArray);

        return $filteredArray;
    }
149881
public static function mergePaths($pathOrPaths, ...$additionalPaths)
    {
        if (is_array($pathOrPaths)) {
            $paths = $pathOrPaths;
        } else {
            $paths = array_merge([$pathOrPaths], $additionalPaths);
        }

        $paths = array_values($paths);

        $prefix = "";
        $suffix = "";
        if (count($paths) > 0) {
            // Save root for first path
            if (self::startsWith($paths[0], ["/", "\\"])) {
                $prefix = "/";
            }

            // Save separator for last path
            if (self::endsWith($paths[count($paths) - 1], ["/", "\\"])) {
                $suffix = "/";
            }
        }

        // Remove leading and trailing separators from parts to not end up with repeated separators (or root by non-first argument and empty root)
        array_walk($paths, function(&$path) {
            $path = str_replace("\\", "/", $path);
            $path = trim($path, "/");
        });

        // Remove empty parts to not end up with repeated separators
        $paths = array_filter($paths);

        $path = implode("/", $paths);

        // Only add suffix if there is a path, to prevent suffix from making root
        if ($path) {
            $path .= $suffix;
        }

        return $prefix . $path;
    }
1245238
protected function getIncludes($includes)
    {
        if ($includes === null) {
            return [];
        }

        $fractal = app(Manager::class);

        return $fractal->parseIncludes($includes)->getRequestedIncludes();
    }
302497
@SuppressWarnings("unchecked")
    public <T extends WebLocatorAbstractBuilder> T setExcludeClasses(final String... excludeClasses) {
        pathBuilder.setExcludeClasses(excludeClasses);
        return (T) this;
    }
771842
private Set<FileAnnotation> applyExcludeFilter(final Set<FileAnnotation> allAnnotations) {
        Set<FileAnnotation> includedAnnotations;
        if (includePatterns.isEmpty()) {
            includedAnnotations = allAnnotations;
        }
        else {
            includedAnnotations = Sets.newHashSet();
            for (FileAnnotation annotation : allAnnotations) {
                for (Pattern include : includePatterns) {
                    if (include.matcher(annotation.getFileName()).matches()) {
                        includedAnnotations.add(annotation);
                    }
                }
            }
        }
        if (excludePatterns.isEmpty()) {
            return includedAnnotations;
        }
        else {
            Set<FileAnnotation> excludedAnnotations = Sets.newHashSet(includedAnnotations);
            for (FileAnnotation annotation : includedAnnotations) {
                for (Pattern exclude : excludePatterns) {
                    if (exclude.matcher(annotation.getFileName()).matches()) {
                        excludedAnnotations.remove(annotation);
                    }
                }
            }
            return excludedAnnotations;
        }
    }
488992
public function getIncludedFiles()
	{
		// We'll cache this internally to avoid running this
		// multiple times.
		if(empty($this->includedFiles))
		{
			$files = get_included_files();

			foreach($files as $filePath)
			{
				$size = $this->readableSize(filesize($filePath));

				$this->includedFiles[] = compact('filePath', 'size');
			}
		}

		return $this->includedFiles;
	}
38780
protected function applyIncludes($dataTypes): array
    {
        $inclusions = explode(',', $this->include);
        // Find any invalid data to include.
        $invalidIncludes = array_diff($inclusions, $dataTypes);
        if (count($invalidIncludes) > 0) {
            $errorMessage = 'WARNING: Invalid include(s)';
            $errorMessage .= ': '.implode(', ', $invalidIncludes).'.'.PHP_EOL;
            $errorMessage .= ' Valid inclusions are '.implode(', ', $dataTypes);

            // Output an error message outlining what invalid exclusions were specified.
            Schematic::warning($errorMessage);
        }
        // Remove any explicitly included data types from the list of data types to export.
        return array_intersect($dataTypes, $inclusions);
    }
1030329
function filterPath(absPath) {
		var relPath = path.relative(launchFolder, absPath)
		var result = excludeList.every(checkExclusion)

		return result

		function checkExclusion(exclusion) { // true: keep the path
			return relPath.substring(0, exclusion.length) != exclusion
		}
	}
671781
private String[] prependContextPath(String[] paths) {
        return Arrays.stream(paths)
            .map(path -> hawtioPath + path)
            .toArray(String[]::new);
    }
773704
public static Filter<ArchivePath> includePaths(final String... paths) {
        return getFilterInstance(IMPL_CLASS_NAME_INCLUDE_PATHS, new Class<?>[] { String[].class },
            new Object[] { paths });
    }
50017
public function getIncludePaths()
	{
		$includes = array();

		foreach ( $this->_manifests as $path => $manifest )
		{
			if ( isset( $manifest['include'] ) )
			{
				foreach ( $manifest['include'] as $paths ) {
					$includes[] = $path . DIRECTORY_SEPARATOR . $paths;
				}
			}
		}

		return $includes;
	}
755323
private function getCompiledViewPaths(string $path) : array
    {
        if (!is_dir($path)) {
            return [];
        }

        $files = [];
        $iter = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),
            RecursiveIteratorIterator::SELF_FIRST,
            RecursiveIteratorIterator::CATCH_GET_CHILD
        );
        $iter->setMaxDepth(0);

        foreach ($iter as $path => $item) {
            if ($item->isFile()) {
                $files[] = $path;
            }
        }

        return $files;
    }
1112365
public static function includePath($paths) {
        $current = array(get_include_path());

        if (is_array($paths)) {
            $current = array_merge($current, $paths);
        } else {
            $current[] = $paths;
        }

        $path = implode(static::DELIMITER, $current);

        set_include_path($path);

        return $path;
    }
927591
public static List<Path> getSubPathList(Path startDirectoryPath,
			int maxDepth, Predicate<Path> filter) {
		List<Path> subPathList =
				Collections.synchronizedList(new ArrayList<>());
		if (isDirectory(startDirectoryPath))
			buildSubPath(startDirectoryPath, maxDepth, filter, subPathList);
		return subPathList;
	}
828905
protected function streamlineFilePaths(array $paths): array
    {
        $paths = \array_map(function ($url) {
            if (!GeneralUtility::isValidUrl($url) && ':' !== $url[0]) {
                $url = GeneralUtility::locationHeaderUrl($url);
            }

            return $url;
        }, $paths);

        $paths = \array_filter($paths, function ($path) {
            return GeneralUtility::isOnCurrentHost($path) && ':' !== $path[0];
        });

        $paths = \array_map(function ($url) {
            return '/' . \ltrim(\str_replace(GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'), '', $url), '/');
        }, $paths);

        return $paths;
    }
444463
private function filesWithFullPaths($dir, $include_hidden = true, $recursive = false)
    {
        $dir = $this->withSlash($dir);

        $result = [];

        if ($dirstream = opendir($dir)) {
            while (false !== ($filename = readdir($dirstream))) {
                $path = $dir . $filename;

                if ($filename != '.' && $filename != '..') {
                    if (is_dir($path)) {
                        if ($recursive) {
                            $files_from_subdir = $this->filesWithFullPaths($path, $recursive);

                            if (is_array($files_from_subdir)) {
                                $result = array_merge($result, $files_from_subdir);
                            }
                        }
                    } else {
                        if (is_file($path) || (is_link($path) && is_file(readlink($path)))) {
                            if (mb_substr($filename, 0, 1) == '.' && !$include_hidden) {
                                continue;
                            }

                            $result[] = $path;
                        }
                    }
                }
            }
        }

        closedir($dirstream);

        return $result;
    }
210486
private function applyExcludesAndIncludes(array $files, array $excludes = [], array $includes = []): array
    {
        if (!$excludes) {
            return $files;
        }

        foreach ($files as $key => $file) {
            if ($this->isMatch($file['relative_path'], $excludes)
                && !$this->isMatch(
                    $file['relative_path'],
                    $includes
                )) {
                unset($files[$key]);
            }
        }

        // Reindex to avoid confusion when comparing last index to count
        return array_values($files);
    }