PHP code example of laradic / composer-merge-plugin
1. Go to this page and download the library: Download laradic/composer-merge-plugin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
laradic / composer-merge-plugin example snippets
// MergePlugin.php
protected function addPackageToRootReplaces(ExtraPackage $package)
{
$root = $this->composer->getPackage();
$rootReplaces = $root->getReplaces();
$constraint = new EmptyConstraint();
$constraint->setPrettyString('*');
$rootReplaces[] = new Link($root->getName(), $package->getPackage()->getName(),$constraint,'replaces','*');
$root->setReplaces($rootReplaces);
$this->logger->info("Added package <comment>{$package->getPackage()->getName()}</comment> to root composer replace");
}