/** * Merge require-dev into RootPackage. * * @param \Composer\Package\RootPackageInterface $root * @param \Arcanedev\Composer\Entities\PluginState $state */ protected function mergeDevRequires(RootPackageInterface $root, PluginState $state) { if (!empty($requires = $this->getPackage()->getDevRequires())) { $this->mergeStabilityFlags($root, $requires); $duplicateLinks = []; $requires = $this->replaceSelfVersionDependencies('require-dev', $requires, $root); $root->setDevRequires($this->mergeLinks($root->getDevRequires(), $requires, $state->replaceDuplicateLinks(), $duplicateLinks)); $state->addDuplicateLinks('require-dev', $duplicateLinks); } }
/** * Get extra config. * * @param \Composer\Package\RootPackageInterface $root * @param \Arcanedev\Composer\Entities\PluginState $state * @param array $extra * * @return array */ private function getExtra(RootPackageInterface $root, PluginState $state, $extra) { $rootExtra = $root->getExtra(); if ($state->replaceDuplicateLinks()) { return self::mergeExtraArray($state->shouldMergeExtraDeep(), $rootExtra, $extra); } if (!$state->shouldMergeExtraDeep()) { foreach (array_intersect(array_keys($extra), array_keys($rootExtra)) as $key) { $this->getLogger()->info("Ignoring duplicate <comment>{$key}</comment> in " . "<comment>{$this->getPath()}</comment> extra config."); } } return static::mergeExtraArray($state->shouldMergeExtraDeep(), $extra, $rootExtra); }