From 125271ab1e51dda7e46a6efb92aa87d8436d4373 Mon Sep 17 00:00:00 2001 From: Bastian Schwarz Date: Wed, 15 Mar 2017 22:22:43 +0100 Subject: [PATCH 1/3] Update Plugin.php Ignoring root package when installing so the plugin will work again when installed into a code sniff package --- src/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin.php b/src/Plugin.php index b3b5bb88..108bd3d6 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -302,7 +302,7 @@ function (PackageInterface $package) { } ); - if ($this->composer->getPackage()->getType() === self::PACKAGE_TYPE) { + if (!$this->composer->getPackage() instanceof \Composer\Package\RootpackageInterface && $this->composer->getPackage()->getType() === self::PACKAGE_TYPE) { $codingStandardPackages[] = $this->composer->getPackage(); } From 050ac1e860c4f7c22e1f3b280b73a8e0488ee947 Mon Sep 17 00:00:00 2001 From: Bastian Schwarz Date: Wed, 15 Mar 2017 22:25:15 +0100 Subject: [PATCH 2/3] Update Plugin.php Documentation --- src/Plugin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Plugin.php b/src/Plugin.php index 108bd3d6..259b7413 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -287,7 +287,10 @@ private function updateInstalledPaths() /** * Iterates through Composers' local repository looking for valid Coding * Standard packages. - * + * + * If the package is the RootPackage (the one the plugin is installed into), + * the package is ignored for now since it needs a different install path logic. + * @return array Composer packages containing coding standard(s) */ private function getPHPCodingStandardPackages() From 42eeda15baca4255aeb708e549ed086c7fe8452f Mon Sep 17 00:00:00 2001 From: Bastian Schwarz Date: Wed, 15 Mar 2017 22:25:52 +0100 Subject: [PATCH 3/3] Update Plugin.php --- src/Plugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Plugin.php b/src/Plugin.php index 259b7413..4857ac55 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -290,7 +290,7 @@ private function updateInstalledPaths() * * If the package is the RootPackage (the one the plugin is installed into), * the package is ignored for now since it needs a different install path logic. - + * * @return array Composer packages containing coding standard(s) */ private function getPHPCodingStandardPackages()