returns files and directories

@return      \FilesystemIterator
483528
public function listAll()
    {
        $iterator = new \FilesystemIterator($this->getAbsolutePath());
        $iterator->setInfoClass(get_class($this));
        return $iterator;
    }
1137662
public function allDirectories()
    {
        $directories = $this->disk->allDirectories('/');

        return collect($directories)->filter(function ($directory) {
            return !(starts_with($directory, '.'));
        })->map(function ($directory) {
            return DIRECTORY_SEPARATOR.$directory;
        })->reduce(function ($allDirectories, $directory) {
            $parts = explode('/', $directory);
            $name = str_repeat('&nbsp;', (count($parts)) * 4).basename($directory);

            $allDirectories[$directory] = $name;

            return $allDirectories;
        }, collect())->prepend($this->breadcrumbRootLabel, '/');
    }
1040813
public function get_files() {
        global $USER;

        $fs = get_file_storage();
        $usercontext = context_user::instance($USER->id);

        return $fs->get_area_files($usercontext->id, 'user', 'draft',
                $this->draftitemid, 'sortorder, filepath, filename', false);
    }
1117154
public function listFiles()
    {
        $innerIterator = new \FilesystemIterator($this->getAbsolutePath());
        $innerIterator->setInfoClass(get_class($this));
        $iterator = new FileFilterType($innerIterator, 'file');
        return $iterator;
    }
803473
public function get_files() {
        $fs = get_file_storage();
        $files = $fs->get_area_files($this->get_context()->id, 'core_competency', 'userevidence', $this->get('id'),
            'filename', false);
        return $files;
    }
1288525
public function getFiles() : array
    {
        if(!$this->_isLoaded) {
            $this->load();
        }

        return array_map(function($file) {
            return new File($this->getPath(). DIRECTORY_SEPARATOR .$file);
        }, $this->_files);
    }
705245
protected function findFiles()
    {
        $ds = new DirectoryScanner();
        $ds->setBasedir($this->dir);
        $ds->setIncludes(array('**/composer.json'));
        $ds->scan();
        return $ds->getIncludedFiles();
    }
169038
function onlyDirectories ()
  {
    return $this->where (function ($f) {
      if (!is_object ($f) || !$f instanceof SplFileInfo)
        throw new \RuntimeException ("You must use FilesystemIterator::CURRENT_AS_PATHNAME with onlyDirectories() ");
      return $f->isDir ();
    });
  }
1185774
public function getDirectoriesIterator()
    {
        if (array() !== ($directories = $this->getDirectories())) {
            return Finder::create()
                    ->files()
                    ->filter($this->getBlacklistFilter())
                    ->ignoreVCS(true)
                    ->in($directories);
        }

        return null;
    }
144260
protected function getFiles() {
        $dir_iterator = new RecursiveDirectoryIterator($this->entryPath);
        $iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::CHILD_FIRST);
        $files = new RegexIterator($iterator, '/^.+\.scss$/i');
        return $files;
    }
922707
public function getBinaryDirectoriesIterator()
    {
        if (array() !== ($directories = $this->getBinaryDirectories())) {
            return Finder::create()
                    ->files()
                    ->filter($this->getBlacklistFilter())
                    ->ignoreVCS(true)
                    ->in($directories);
        }

        return null;
    }
59925
public function getFileList()
    {
        $files = new Filesystem;
        return array_map(function (SplFileInfo $file) {
            return $file->getRelativePathname();
        }, $files->allFiles($this->stubDirectory));
    }
619247
protected function getSiteFiles()
    {
        $files = array_filter($this->filesystem->allFiles(KATANA_CONTENT_DIR), function (SplFileInfo $file) {
            return $this->filterFile($file);
        });

        $this->appendFiles($files);

        return $files;
    }
682939
protected function _getPaths()
    {
        $directories = $this->_createDirectoryIterator($this->_getRootDir());
        $flattened   = $this->_createRecursiveIteratorIterator($directories);
        $flattened->setMaxDepth($this->_getMaxDepth());
        $filter = $this->_createFilterIterator($flattened, function (SplFileInfo $current, $key, Iterator $iterator) {
            return $this->_filterFile($current);
        });

        return $filter;
    }
111361
protected function getDataDirectoryFiles()
	{
		$facade = new \File_Iterator_Facade();

		return $facade->getFilesAsArray($this->dataDirectory, $_GET[self::TEST_ID_VARIABLE]);
	}
1211047
protected function getFilesystem()
	{
		if (!isset($this->filesystem)) {
			$this->filesystem = new Filesystem($this->getAdapter());
		}
		return $this->filesystem;
	}
1192760
public function getFiles()
    {
        if (empty($this->files)) {
            foreach ($this->path as $path) {
                if (is_dir($path)) {
                    $this->files = array_merge($this->files, $this->getFilesFromDir($path));
                } elseif (is_file($path)) {
                    $this->files[$path] = new SplFileInfo($path, $path, $path);
                }
            }
        }

        return $this->files;
    }