public function listFiles($regexFilter = null)
    {
        $filesList = [];
        if ($regexFilter) {
            $filter = function ($file) use (&$filesList, $regexFilter) {
                // push/pop an error handler here to to make sure no error/exception thrown if $expected is not a regex
                set_error_handler(function () {
                });
                $match = preg_match($regexFilter, $file);
                restore_error_handler();

                if ($match === 1) {
                    $filesList[] = $file;
                } elseif ($match === false) {
                    throw new \RuntimeException("regular expression match on '$file' failed with error. Please check if pattern is valid regular expression.");
                }
            };
        } else {
            $filter = function ($file) use (&$filesList) {
                $filesList[] = $file;
            };
        }
        $this->repository->each($filter);

        return $filesList;
    }
public function listFiles($regexFilter = null)
    {
        $filesList = [];
        if ($regexFilter) {
            $filter = function ($file) use (&$filesList, $regexFilter) {
                // push/pop an error handler here to to make sure no error/exception thrown if $expected is not a regex
                set_error_handler(function () {
                });
                $match = preg_match($regexFilter, $file);
                restore_error_handler();

                if ($match === 1) {
                    $filesList[] = $file;
                } elseif ($match === false) {
                    throw new \RuntimeException("regular expression match on '$file' failed with error. Please check if pattern is valid regular expression.");
                }
            };
        } else {
            $filter = function ($file) use (&$filesList) {
                $filesList[] = $file;
            };
        }
        $this->repository->each($filter);

        return $filesList;
    }
public function listFiles ( $ regexFilter = null ) { $ filesList = [ ] ; if ( $ regexFilter ) { $ filter = function ( $ file ) use ( & $ filesList , $ regexFilter ) { // push/pop an error handler here to to make sure no error/exception thrown if $expected is not a regex set_error_handler ( function ( ) { } ) ; $ match = preg_match ( $ regexFilter , $ file ) ; restore_error_handler ( ) ; if ( $ match === 1 ) { $ filesList [ ] = $ file ; } elseif ( $ match === false ) { throw new \ RuntimeException ( "regular expression match on '$file' failed with error. Please check if pattern is valid regular expression." ) ; } } ; } else { $ filter = function ( $ file ) use ( & $ filesList ) { $ filesList [ ] = $ file ; } ; } $ this -> repository -> each ( $ filter ) ; return $ filesList ; }
List all files that are within the archive

@param string|null $regexFilter regular expression to filter returned files/folders. See @link http://php.net/manual/en/reference.pcre.pattern.syntax.php

@throws \RuntimeException

@return array
List all files that are within the archive