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

Breadcrumb

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

function Plugin::cleanInstalledPaths

Iterate trough all known paths and check if they are still valid.

If path does not exists, is not an directory or isn't readable, the path is removed from the list.

Return value

bool True if changes where made, false otherwise

1 call to Plugin::cleanInstalledPaths()
Plugin::onDependenciesChangedEvent in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php
Entry point for post install and post update events.

File

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

Class

Plugin
PHP_CodeSniffer standard installation manager.

Namespace

PHPCSStandards\Composer\Plugin\Installers\PHPCodeSniffer

Code

private function cleanInstalledPaths() {
    $changes = false;
    foreach ($this->installedPaths as $key => $path) {
        // This might be a relative path as well
        $alternativePath = realpath($this->getPHPCodeSnifferInstallPath() . \DIRECTORY_SEPARATOR . $path);
        if ((is_dir($path) === false || is_readable($path) === false) && ($alternativePath === false || is_dir($alternativePath) === false || is_readable($alternativePath) === false)) {
            unset($this->installedPaths[$key]);
            $changes = true;
        }
    }
    return $changes;
}

API Navigation

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