Returns an array of contained file objects if this file is a directory, otherwise false

Note that directory links (`.` and `..`) are always ignored

@return array | false
198537
public function getContainedFiles()
    {
        if ($this->isDir()) {
            $files = array();
            $basePath = rtrim($this->_realpath, DIRECTORY_SEPARATOR);
            foreach (scandir($this->_realpath) as $fileName) {
                if (!in_array($fileName, array('.','..'))) {
                    $files[] = new File($basePath.DIRECTORY_SEPARATOR.$fileName);
                }
            }

            return $files;
        }

        return false;
    }
1094277
public function all()
	{
		$path = $this->directory;

		$data = array();

		$dirIterator = new DirectoryIterator($path);
		foreach ($dirIterator as $folder)
		{
			if ($folder->isDot() || !$folder->isDir())
			{
				continue;
			}

			$name = $folder->getFilename();

			$item = new Auditor($name);

			$files = new DirectoryIterator($path . DIRECTORY_SEPARATOR . $name);

			foreach ($files as $file)
			{
				if ($file->isDot() || $file->isDir() || in_array(strtolower($file->getFilename()), static::$skip))
				{
					continue;
				}

				$item->tally(filesize($path . DIRECTORY_SEPARATOR . $name . DIRECTORY_SEPARATOR . $file->getFilename()) / 1024);
			}

			$data[$name] = $item;
		}

		return $data;
	}
1351103
public function toArray()
    {
        $result = parent::toArray();

        $result['hasFile'] = false;

        if ($this->getFileNameFromReport()) {
            /** @var Directory $queueStorage */
            $queueStorage = $this->fileSystemService
                ->getDirectory(QueueDispatcherInterface::FILE_SYSTEM_ID);

            if ($queueStorage->getFile($this->getFileNameFromReport())->exists()) {
                $result['hasFile'] = true;
            }
        }

        return $result;
    }
705245
protected function findFiles()
    {
        $ds = new DirectoryScanner();
        $ds->setBasedir($this->dir);
        $ds->setIncludes(array('**/composer.json'));
        $ds->scan();
        return $ds->getIncludedFiles();
    }
1327460
private function getFiles(): array
	{
		$result = [];
		$files = Finder::find('*')
			->in($this->getFullPath());
		foreach ($files as $file) {
			$result[] = new FileInfo($file);
		}
		usort($result, function ($a, $b) {
			if ($a->isDir == $b->isDir) {
				return strcmp($a->name, $b->name);
			} else {
				if ($a->isDir) {
					return -1;
				} else {
					return 1;
				}
			}
		});
		return $result;
	}
275408
protected function getFileNames(string $directory = 'default'): array
    {
        $directoryIterator = $this->getDirectoryIterator($directory);
        $files = [];
        foreach ($directoryIterator as $file) {
            $this->resolveFile($file, $files);
        }
        return $files;
    }
9347
public function getFilesOfDir($dir)
    {
        $iterator = new DirectoryIterator($dir);

        $iterator = new CallbackFilterIterator(
            $iterator,
            function (SplFileInfo $current, $key, DirectoryIterator $iterator) {
                return !$iterator->isDot();
            }
        );

        return $iterator;
    }
1168992
public function getSubdirectories()
    {
        $directories = array();
        if ($directoryHandle = opendir($this->m_sPath)) {
            while (false !== ($sFileName = readdir($directoryHandle))) {
                if (
                    $sFileName != "."
                        && $sFileName != ".."
                        && (is_dir($this->m_sPath . "/" . $sFileName))) {

                    array_push($directories, $sFileName);
                }
            }
        }
        sort($directories);
        return $directories;
    }
801967
protected function _getIncludedFiles()
    {
        if (null !== $this->_includedFiles) {
            return $this->_includedFiles;
        }

        $this->_includedFiles = get_included_files();
        sort($this->_includedFiles);
        return $this->_includedFiles;
    }
521768
public function getSourceFiles()
    {
        $sourceFiles = array();
        $ignore = $this->configuration->get('ignore');

        if (is_dir($this->get('source'))) {
            $recursiveIterator = new \RecursiveIteratorIterator(
                new \RecursiveDirectoryIterator($this->get('source'))
            );

            foreach ($recursiveIterator as $file) {
                if (!$ignore || !preg_match($ignore, $file->getPathname())) {
                    $sourceFiles[$file->getFilename()] = $file->getPathname();
                }
            }
        }

        return $sourceFiles;
    }
1028949
private function getFileResources()
    {
        $paths = array();

        foreach ($this->directories as $directory) {
            foreach ($directory as $file) {
                $relative = $this->getRelativeName($file, $directory);

                if (!isset($paths[$relative])) {
                    $paths[$relative] = $file;
                }
            }
        }

        return array_values($paths);
    }
245034
public function toArray()
    {
        $result = parent::toArray();

        $result['hasFile'] = false;

        $fileNameOrSerial = $this->getFileNameFromReport();

        if ($fileNameOrSerial) {
            $result['hasFile'] = $this->isFileReferenced($fileNameOrSerial)
                ? true
                : $this->isFileStoredInQueueStorage($fileNameOrSerial);
        }

        return $result;
    }
583319
public function getDirs($dir)
    {
        $dirArr = array();
        if ($handler = opendir($dir)) {
            while ($file = readdir($handler)) {
                $path = realpath("{$dir}/{$file}");
                if (is_dir($path)) {
                    
                    if (in_array($file, array('.', '..'))) {
                        continue;
                    }
                    
                    if (preg_match('/^[a-zA-z0-9]+$/', $file)) {
                        $dirArr[] = $path;
                        $dirArr = array_merge($dirArr, self::getDirs($path));
                    }
                }
            }
            closedir($handler);
        }
        return $dirArr;
    }
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;
    }
51734
public function find()
    {
        $files = [];

        foreach ($this->getDirectoryIterator() as $file) {
            if ($this->getExtension($file) !== 'php') continue;

            $files[] = $file->getPathname();
        }

        return $files;
    }
1117154
public function listFiles()
    {
        $innerIterator = new \FilesystemIterator($this->getAbsolutePath());
        $innerIterator->setInfoClass(get_class($this));
        $iterator = new FileFilterType($innerIterator, 'file');
        return $iterator;
    }
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;
	}