public function MergePlugin::onDependencySolve in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/wikimedia/composer-merge-plugin/src/MergePlugin.php \Wikimedia\Composer\MergePlugin::onDependencySolve()
Handle an event callback for pre-dependency solving phase of an install or update by adding any duplicate package dependencies found during initial merge processing to the request that will be processed by the dependency solver.
Parameters
InstallerEvent $event:
File
- vendor/
wikimedia/ composer-merge-plugin/ src/ MergePlugin.php, line 224
Class
- MergePlugin
- Composer plugin that allows merging multiple composer.json files.
Namespace
Wikimedia\ComposerCode
public function onDependencySolve(InstallerEvent $event) {
$request = $event
->getRequest();
foreach ($this->state
->getDuplicateLinks('require') as $link) {
$this->logger
->info("Adding dependency <comment>{$link}</comment>");
$request
->install($link
->getTarget(), $link
->getConstraint());
}
if ($this->state
->isDevMode()) {
foreach ($this->state
->getDuplicateLinks('require-dev') as $link) {
$this->logger
->info("Adding dev dependency <comment>{$link}</comment>");
$request
->install($link
->getTarget(), $link
->getConstraint());
}
}
}