function Standards::printInstalledStandards
Prints out a list of installed coding standards.
Return value
void
2 calls to Standards::printInstalledStandards()
- Config::processShortArgument in vendor/
squizlabs/ php_codesniffer/ src/ Config.php - Processes a short (-e) command line argument.
- Runner::init in vendor/
squizlabs/ php_codesniffer/ src/ Runner.php - Init the rulesets and other high-level settings.
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Util/ Standards.php, line 319
Class
Namespace
PHP_CodeSniffer\UtilCode
public static function printInstalledStandards() {
$installedStandards = self::getInstalledStandards();
$numStandards = count($installedStandards);
if ($numStandards === 0) {
echo 'No coding standards are installed.' . PHP_EOL;
}
else {
$lastStandard = array_pop($installedStandards);
if ($numStandards === 1) {
echo "The only coding standard installed is {$lastStandard}" . PHP_EOL;
}
else {
$standardList = implode(', ', $installedStandards);
$standardList .= ' and ' . $lastStandard;
echo 'The installed coding standards are ' . $standardList . PHP_EOL;
}
}
}