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

Breadcrumb

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

function Plugin::loadInstalledPaths

Load all paths from PHP_CodeSniffer into an array.

Throws

LogicException

ProcessFailedException

RuntimeException

2 calls to Plugin::loadInstalledPaths()
Plugin::onDependenciesChangedEvent in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Entry point for post install and post update events.
Plugin::verifySaveSuccess in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Verify that the paths which were expected to be saved, have been.

File

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

Class

Plugin
PHP_CodeSniffer standard installation manager.

Namespace

PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer

Code

private function loadInstalledPaths() {
    if ($this->isPHPCodeSnifferInstalled() === true) {
        $this->processExecutor
            ->execute($this->getPhpcsCommand() . ' --config-show', $output, $this->getPHPCodeSnifferInstallPath());
        $regex = sprintf(self::PHPCS_CONFIG_REGEX, self::PHPCS_CONFIG_KEY);
        if (preg_match($regex, $output, $match) === 1) {
            $phpcsInstalledPaths = str_replace(self::PHPCS_CONFIG_KEY . ': ', '', $match[0]);
            $phpcsInstalledPaths = trim($phpcsInstalledPaths);
            if ($phpcsInstalledPaths !== '') {
                $this->installedPaths = explode(',', $phpcsInstalledPaths);
            }
        }
    }
}

API Navigation

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