moodle-local_codechecker
moodle-local_codechecker copied to clipboard
Review includes in index.php and run.php
While reviewing https://github.com/moodlehq/moodle-local_codechecker/pull/90, @vmdef has raised a couple of interesting things to review related to the included files in index.php and run.php:
if (is_file(__DIR__ . '/phpcs/autoload.php') === true) {
include_once(__DIR__ . '/phpcs/autoload.php');
} else {
include_once('PHP/CodeSniffer/autoload.php');
}
// PHPCompatibility autoloading.
require_once('PHPCSAliases.php');
- "PHP/CodeSniffer/autoload.php" include might not be required any more.
- PHPCSAliases.php is included through PHPCompatibility/ruleset.xml, so we don't need to include it here.
This issue is about the check if this piece of code can be improved and some of these includes can be removed definitively.