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

Breadcrumb

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

function Plugin::verifySaveSuccess

Verify that the paths which were expected to be saved, have been.

Return value

int Exit code. 0 for success, 1 for failure.

1 call to Plugin::verifySaveSuccess()
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 322

Class

Plugin
PHP_CodeSniffer standard installation manager.

Namespace

PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer

Code

private function verifySaveSuccess() {
    $exitCode = 1;
    $expectedPaths = $this->installedPaths;
    // Request the currently set installed paths after the save.
    $this->loadInstalledPaths();
    $registeredPaths = array_intersect($this->installedPaths, $expectedPaths);
    $registeredCount = count($registeredPaths);
    $expectedCount = count($expectedPaths);
    if ($expectedCount === $registeredCount) {
        $exitCode = 0;
    }
    if ($exitCode === 1 && $this->io
        ->isVerbose()) {
        $verificationMessage = sprintf("Paths to external standards found by the plugin: <info>%s</info>\n" . 'Actual paths registered with PHPCS: <info>%s</info>', implode(', ', $expectedPaths), implode(', ', $this->installedPaths));
        $this->io
            ->write($verificationMessage);
    }
    return $exitCode;
}

API Navigation

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