src/main/php/CommandLine/Library/GitChangeSetFilter.php
protected function iterateOverFiles(string $filter, array $files, array $list) : array
    {
        $result = [];
        foreach ($files as $filePath) {
            //Filter by filter.
            if ($filter !== '' && substr($filePath, -strlen($filter)) !== $filter) {
                continue;
            }
            //Filter by black/white List
            $directory = dirname($filePath);
            $lastDirectoryPath = $filePath;
            while (!in_array($directory, [$this->environment->getRootDirectory(), '', $lastDirectoryPath], true)
            ) {
                if (array_key_exists($directory, $list)) {
                    if ($list[$directory] === true) {
                        $result[] = $filePath;
                    }
                    continue 2;
                }
                $lastDirectoryPath = $directory;
                $directory = dirname($directory);
            }
            $result[] = $filePath;
        }
        return $result;
    }
protected function iterateOverFiles(string $filter, array $files, array $list) : array
    {
        $result = [];
        foreach ($files as $filePath) {
            //Filter by filter.
            if ($filter !== '' && substr($filePath, -strlen($filter)) !== $filter) {
                continue;
            }
            //Filter by black/white List
            $directory = dirname($filePath);
            $lastDirectoryPath = $filePath;
            while (!in_array($directory, [$this->environment->getRootDirectory(), '', $lastDirectoryPath], true)
            ) {
                if (array_key_exists($directory, $list)) {
                    if ($list[$directory] === true) {
                        $result[] = $filePath;
                    }
                    continue 2;
                }
                $lastDirectoryPath = $directory;
                $directory = dirname($directory);
            }
            $result[] = $filePath;
        }
        return $result;
    }
protected function iterateOverFiles ( string $ filter , array $ files , array $ list ) : array { $ result = [ ] ; foreach ( $ files as $ filePath ) { //Filter by filter. if ( $ filter !== '' && substr ( $ filePath , - strlen ( $ filter ) ) !== $ filter ) { continue ; } //Filter by black/white List $ directory = dirname ( $ filePath ) ; $ lastDirectoryPath = $ filePath ; while ( ! in_array ( $ directory , [ $ this -> environment -> getRootDirectory ( ) , '' , $ lastDirectoryPath ] , true ) ) { if ( array_key_exists ( $ directory , $ list ) ) { if ( $ list [ $ directory ] === true ) { $ result [ ] = $ filePath ; } continue 2 ; } $ lastDirectoryPath = $ directory ; $ directory = dirname ( $ directory ) ; } $ result [ ] = $ filePath ; } return $ result ; }
Iterates over the files and returns files as configured in list and filter.

@param string   $filter
@param string[] $files
@param bool[]   $list

@return array
Iterates over the files and returns files as configured in list and filter .