Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/ExtraPackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ public function getMergedRequirements()
return array_keys($this->mergedRequirements);
}

/**
* Get the name of this package
*
* @return string
*/
public function getName()
{
return $this->json['name'];
}

/**
* Read the contents of a composer.json style file into an array.
*
Expand Down
7 changes: 7 additions & 0 deletions src/MergePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,13 @@ protected function mergeFile(RootPackageInterface $root, $path)

$package = new ExtraPackage($path, $this->composer, $this->logger);

if (isset($root->getRequires()[$package->getName()])) {
$this->logger->info(
"Ignoring composer json already required by root: <comment>{$package->getName()}</comment>"
);
return;
}

if (isset($this->loadedNoDev[$path])) {
$this->logger->info(
"Loading -dev sections of <comment>{$path}</comment>..."
Expand Down