function Plugin::loadInstalledPaths
Load all paths from PHP_CodeSniffer into an array.
Throws
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\PHPCodeSnifferCode
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);
}
}
}
}