paths getter and setter

when paths empty:
return all registerd paths

when paths an array:
adds paths to the index and optional create a define.

@param array 			$paths
@param bool			$define
@return array|void
335042
public static function paths( $paths = null, $define = true )
	{
		if ( is_null( $paths ) )
		{
			return static::$paths;
		}
		
		foreach( $paths as $key => $path )
		{
			static::$paths[$key] = $path;
			
			if ( $define === true )
			{
				define( strtoupper( $key ).'PATH', $path );
			}
		}
	}
195278
public function getPhpFiles(array $paths): FileCollection
    {
        $this->files = new FileCollection;
        foreach ($paths as $path) {
            $this->getPhpFilesFromPath($path);
        }

        return $this->files;
    }
560706
public function addPath($path, $prepend = false)
    {
        if (is_array($path)) {
            foreach ($path as $directory) {
                $this->addPath($directory, $prepend);
            }
        } else {
            if ($prepend) {
                $this->paths = array_merge([$path], $this->paths);
            } else {
                $this->paths[] = $path;
            }
        }
    }
186074
public function prep_paths(array $paths)
	{
		foreach ($paths as &$path)
		{
			$path = $this->prep_path($path);
		}
		return $paths;
	}
1368154
public function concat($paths)
    {
        if (is_array($paths))
            $paths = implode('/', $paths);
        return $this->fullPath() . '/' . $paths;
    }
495094
public function set($prefix, $paths) {
		if (!$prefix) {
			$this->fallbackDirs = (array) $paths;
			return;
		}

		$this->prefixes[$prefix] = (array) $paths;
	}
1349729
public function setPaths(array $paths, $clearCache = true, $group = '__DEFAULT__')
	{
		$this->paths[$group] = [];
		$this->addPaths($paths, false, $group);

		if ($clearCache)
		{
			$this->cache = [];
		}
	}
1059560
public function addDefinitions(array $definitions)
    {
        $resource          = new DefinitionResource($definitions);
        $this->definitions = array_merge($resource->getDefinitions(), $this->definitions);
    }
877228
public function addLocations(array $paths): Finder
    {
        foreach ($paths as $path => $url) {
            $this->addLocation($path, $url);
        }

        return $this;
    }
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;
    }
26769
public function bindInstallPaths(array $paths)
    {
        $this->instance('path', realpath($paths['app']));

        foreach (array_except($paths, array('app')) as $key => $value) {
            $this->instance("path.{$key}", realpath($value));
        }
    }
747462
public function setBlackList($paths)
    {
        $paths = (is_array($paths)) ? $paths : array($paths);

        $this->blackList = $paths;

        return $this;
    }
246514
protected function retrieveAllFiles(array $paths)
    {
        $files = [];

        foreach ($paths as $path) {
            $newFiles = [];

            try {
                $newFiles = $this->retrieveFiles($path);
            } catch (FileSystemException $e) {
                continue;
            } finally {
                $files = array_merge($files, $newFiles);
            }
        }

        return $files;
    }
445471
public static function setPaths($paths, $recursive = false, $filter = '')
    {
        
		foreach($paths as $path){
    		if(!preg_match("/\/$/", $path)){
    			$path .= '/';
    		}
			if(empty($filter) || strtolower($filter) == tao_helpers_Scriptloader::CSS){
				foreach(glob($path . "*." . tao_helpers_Scriptloader::CSS) as $cssFile){
					self::$cssFiles[] = $path . $cssFile;
				}
			}
			if(empty($filter) || strtolower($filter) == tao_helpers_Scriptloader::JS){
				foreach(glob($path . "*." . tao_helpers_Scriptloader::JS) as $jsFile){
					self::$jsFiles[] = $path . $jsFile;
				}
			}
			if($recursive){
				$dirs = array();
				foreach(scandir($path) as $file){
					if(is_dir($path.$file) && $file != '.' && $file != '..'){
						$dirs[] = $path.$file;
					}
				}
				if(count($dirs) > 0){
					self::setPaths($dirs, true, $filter);
				}
			}
    	}
        
    }
868828
private function inPaths($pathInfo, array $paths)
    {
        foreach ($paths as $path) {
            if (preg_match('#'.$path.'#', $pathInfo)) {
                return true;
            }
        }

        return false;
    }
3688
public function includePaths($path)
	{
		$paths = is_array($path) ? $path : array($path);
		$this->_paths = array_merge($paths,$this->_paths);
		return $this;
	}
610006
protected static function convertToTree(array $paths): array
    {
        foreach ($paths as $index => $path) {
            static::convertPathToTree($paths, $index, $path);
        }

        return $paths;
    }