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