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

Breadcrumb

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

function Plugin::getPhpcsCommand

Get the command to call PHPCS.

2 calls to Plugin::getPhpcsCommand()
Plugin::loadInstalledPaths in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Load all paths from PHP_CodeSniffer into an array.
Plugin::saveInstalledPaths in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Save all coding standard paths back into PHP_CodeSniffer

File

vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php, line 354

Class

Plugin
PHP_CodeSniffer standard installation manager.

Namespace

PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer

Code

protected function getPhpcsCommand() {
    // Determine the path to the main PHPCS file.
    $phpcsPath = $this->getPHPCodeSnifferInstallPath();
    if (file_exists($phpcsPath . '/bin/phpcs') === true) {
        // PHPCS 3.x.
        $phpcsExecutable = './bin/phpcs';
    }
    else {
        // PHPCS 2.x.
        $phpcsExecutable = './scripts/phpcs';
    }
    return vsprintf('%s %s', array(
        'php executable' => $this->getPhpExecCommand(),
        'phpcs executable' => $phpcsExecutable,
    ));
}

API Navigation

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