Returns the possible folder or file issues
@return array
184953
private function getWarningLogs()
    {
        $melisTool  = $this->getServiceLocator()->get('MelisCoreTool');
        $moduleSvc  = $this->getServiceLocator()->get('ModulesService');
        $allModules = $moduleSvc->getAllModules();
        $excludeModules = ['MelisFront', 'MelisEngine', 'MelisInstaller', 'MelisAssetManager', 'MelisModuleConfig', 'MelisSites'];
        $modules    = [];
//         foreach($allModules as $module) {
//             if(!in_array($module, $excludeModules)) {
//                 $modules[] = $moduleSvc->getModulePath($module).'/language';
//             }
//         }

        $folderPath = [
            $_SERVER['DOCUMENT_ROOT'] . '../module/MelisModuleConfig/',
            $_SERVER['DOCUMENT_ROOT'] . '../module/MelisModuleConfig/languages',
            $_SERVER['DOCUMENT_ROOT'] . '../module/MelisModuleConfig/config',
            $_SERVER['DOCUMENT_ROOT'] . '../module/MelisModuleConfig/config/translation.list.php',
        ];

        $logs       = [];
        foreach(array_merge($modules, $folderPath) as $path) {
            if(file_exists($path)) {
                if(!is_readable($path)) {
                    // this folder is not readable
                    $logs[] = $melisTool->getTranslation('tr_meliscore_tool_language_lang_folder_not_readable', [$path]);
                }
                else {
                    if(!is_writable($path)) {
                        // this folder is not writable
                        $logs[] = $melisTool->getTranslation('tr_meliscore_tool_language_lang_folder_not_writable', [$path]);
                    }
                }
            }
//             else {
//                 $logs[] = $melisTool->getTranslation('tr_meliscore_tool_language_lang_folder_not_exist', [$path]);
//             }
        }

        return $logs;
    }
1062761
public function getFiles()
    {
        if (!in_array($this->getMethod(), array('POST', 'PUT', 'DELETE', 'PATCH'))) {
            return array();
        }

        $files = array();

        foreach ($this->fields->all() as $name => $field) {
            if ($field->isDisabled()) {
                continue;
            }

            if ($field instanceof Field\FileFormField) {
                $files[$name] = $field->getValue();
            }
        }

        return $files;
    }
1255798
public function getFileNames()
    {

        $filesArray = $this->getFiles();
        $filenamesArray = array();

        foreach ($filesArray as $file) {
            $sFileName = $file->getName();
            array_push($filenamesArray, $sFileName);
        }
        sort($filenamesArray);
        return $filenamesArray;
    }
404249
public function getErrorList()
    {
        $dirIterator = new \RecursiveDirectoryIterator($this->directory);
        $iterator = new \RecursiveIteratorIterator($dirIterator, \RecursiveIteratorIterator::SELF_FIRST);
        $files = array();

        $ignores = $this->ignore;
        $ignores[] = 'phpci.yml';
        $ignores[] = '.phpci.yml';

        foreach ($iterator as $file) {
            $filePath = $file->getRealPath();
            $skipFile = false;
            foreach ($ignores as $ignore) {
                if (stripos($filePath, $ignore) !== false) {
                    $skipFile = true;
                    break;
                }
            }

            // Ignore hidden files, else .git, .sass_cache, etc. all get looped over
            if (stripos($filePath, DIRECTORY_SEPARATOR . '.') !== false) {
                $skipFile = true;
            }

            if ($skipFile == false) {
                $files[] = $file->getRealPath();
            }
        }

        $files = array_filter(array_unique($files));
        $errorCount = 0;

        foreach ($files as $file) {
            foreach ($this->searches as $search) {
                $fileContent = file_get_contents($file);
                $allLines = explode(PHP_EOL, $fileContent);
                $beforeString = strstr($fileContent, $search, true);

                if (false !== $beforeString) {
                    $lines = explode(PHP_EOL, $beforeString);
                    $lineNumber = count($lines);
                    $content = trim($allLines[$lineNumber - 1]);

                    $errorCount++;

                    $fileName = str_replace($this->directory, '', $file);

                    $this->build->reportError(
                        $this->phpci,
                        'technical_debt',
                        $content,
                        PHPCI\Model\BuildError::SEVERITY_LOW,
                        $fileName,
                        $lineNumber
                    );
                }
            }
        }

        return $errorCount;
    }
486023
public function get_files() {
        // The files array can contain stored file ids, so we need to get instances if asked.
        foreach ($this->files as $id => $listfile) {
            if (is_numeric($listfile)) {
                $fs = get_file_storage();

                if ($file = $fs->get_file_by_id($id)) {
                    $this->files[$id] = $file;
                } else {
                    unset($this->files[$id]); // Index is out of date and referencing a file that does not exist.
                }
            }
        }

        return $this->files;
    }
846930
public function getFolders() {

		$result = [];
		$files = glob($this->path . '*', GLOB_ONLYDIR);

		if($files) {
			foreach($files as $f) {
				$result[] = self::getInstance($f);
			}
		}

		return $result;

	}
721782
public function find_problems() {
        global $DB;
        static $answer = null;

        if (is_null($answer)) {
            $categories = $DB->get_records('course_categories', array(), 'id');

            // Look for missing parents.
            $missingparent = tool_health_category_find_missing_parents($categories);

            // Look for loops.
            $loops = tool_health_category_find_loops($categories);

            $answer = array($missingparent, $loops);
        }

        return $answer;
    }
243040
public function files()
    {
        $files = (new Finder)->files();

        foreach ($this->ignoredFiles as $name) {
            $files->notName($name);
        }

        foreach ($this->searchedFiles as $name) {
            $files->name($name);
        }

        return $files->exclude($this->ignoredDirectories)->in($this->dir);
    }
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;
	}
1195526
public function getFiles()
    {
        $finders = [
            MainConfigurationFinder::class,
            ContextualConfigurationFinder::class,
            PluginsConfigurationFinder::class,
        ];

        // Filter out non-existing folders
        $folders = $this->getFolders();
        if (!$folders) {
            return [];
        }

        $files = [];
        foreach ($folders as $folder) {
            foreach ($finders as $finder) {
                /** @var AbstractConfigurationFinder $finder */
                $finder = new $finder($this->files, $folder);
                $files = array_merge($files, $finder->getFiles());
            }
        }

        // Load consolidated configuration
        $folder = $this->paths->getRocketeerPath();
        if ($this->files->has($folder)) {
            $consolidated = new ConsolidatedConfigurationFinder($this->files, $folder);
            $files = array_merge($files, $consolidated->getFiles());
        }

        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);
    }
717773
protected function getFiles() : array
    {
        $fileOrDirectory = base_path($this->argument('path'));
        if (! $this->files->exists($fileOrDirectory)) {
            $this->error($this->argument('path').' is not a file or a directory.');
            exit();
        }
        if ($this->files->isFile($fileOrDirectory)) {
            $files = [$fileOrDirectory];
        } elseif ($this->files->isDirectory($fileOrDirectory)) {
            $files = $this->files->files($fileOrDirectory);
        }

        return $files;
    }
241839
public function getAllowedFileTypes()
	{
		$arrFileTypesOfParents = array();
		
		if ($this->fileTypesInherit && !$this->isRootCategory() && $this->hasParentCategory())
		{
			$arrFileTypesOfParents = $this->parentCategory->getAllowedFileTypes();
		}
		
		$arrFileTypes = DmsUtils::getUniqueFileTypes($this->fileTypes, $arrFileTypesOfParents);
		
		return $arrFileTypes;
	}
856919
public function detectConflicts()
    {
        $conflicts = [];
        $apps = $this->graph->getLeafNodes();
        foreach ($apps as $name => $latest) {
            if (count($latest) > 1) {
                $conflicts[$name] = $latest;
            }
        }

        return $conflicts;
    }
741602
protected function getIssueListing()
    {
        $issues = $this
            ->taskGitHubIssueList(
                $this->getToken(),
                $this->getAccount(),
                $this->getRepository()
            )
            ->run();

        $listing = [];
        foreach ($issues as $issue) {
            if (!isset($issue['title'])) {
                continue;
            }
            $number = $issue['number'];
            $listing[$number] = $issue['title'];
        }

        return $listing;
    }
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);
    }
1210169
private function getFilesContainingOldKey()
    {
        $affectedFiles = [];

        foreach ($this->manager->getAllViewFilesWithTranslations() as $file => $keys) {
            foreach ($keys as $key) {
                if ($key == $this->argument('oldKey')) {
                    $affectedFiles[$file][] = $key;
                }
            }
        }

        return $affectedFiles;
    }