diff --git a/phpcs.xml.dist b/phpcs.xml.dist index c2e6d539..76331384 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -15,5 +15,9 @@ - + + + + diff --git a/src/Plugin.php b/src/Plugin.php index ce17952b..3539a2c3 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -269,7 +269,8 @@ private function cleanInstalledPaths() // This might be a relative path as well $alternativePath = realpath($this->getPHPCodeSnifferInstallPath() . DIRECTORY_SEPARATOR . $path); - if ((is_dir($path) === false || is_readable($path) === false) && + if ( + (is_dir($path) === false || is_readable($path) === false) && (is_dir($alternativePath) === false || is_readable($alternativePath) === false) ) { unset($this->installedPaths[$key]); @@ -362,7 +363,8 @@ function (PackageInterface $package) { } ); - if (! $this->composer->getPackage() instanceof RootpackageInterface + if ( + ! $this->composer->getPackage() instanceof RootpackageInterface && $this->composer->getPackage()->getType() === self::PACKAGE_TYPE ) { $codingStandardPackages[] = $this->composer->getPackage(); @@ -441,7 +443,8 @@ private function getMaxDepth() $maxDepth = $extra[self::KEY_MAX_DEPTH]; $minDepth = $this->getMinDepth(); - if ((string) (int) $maxDepth !== (string) $maxDepth /* Must be an integer or cleanly castable to one */ + if ( + (string) (int) $maxDepth !== (string) $maxDepth /* Must be an integer or cleanly castable to one */ || $maxDepth <= $minDepth /* Larger than the minimum */ || is_float($maxDepth) === true /* Within the boundaries of integer */ ) {