Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Standards.php

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

Standards

Namespace

PHP_CodeSniffer\Util

Code

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;
        }
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal