Skip to content

Commit

Permalink
Merge pull request #21 from codenamephp/master
Browse files Browse the repository at this point in the history
Adds `instanceof` check to prevent root package from being installed.
  • Loading branch information
Potherca authored Mar 16, 2017
2 parents 8232dc1 + 42eeda1 commit 526b9c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ 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)
*/
Expand All @@ -302,7 +305,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();
}

Expand Down

0 comments on commit 526b9c8

Please sign in to comment.