Wikimedia\Composer\Merge\PluginState::addDuplicateLinks PHP Метод

    public function addDuplicateLinks($type, array $packages)
    {
        if (!isset($this->duplicateLinks[$type])) {
            $this->duplicateLinks[$type] = array();
        }
        $this->duplicateLinks[$type] = array_merge($this->duplicateLinks[$type], $packages);
    }

Usage Example

 /**
  * Merge two collections of package links and collect duplicates for
  * subsequent processing.
  *
  * @param string $type 'require' or 'require-dev'
  * @param array $origin Primary collection
  * @param array $merge Additional collection
  * @param PluginState $state
  * @return array Merged collection
  */
 protected function mergeOrDefer($type, array $origin, array $merge, $state)
 {
     $dups = array();
     foreach ($merge as $name => $link) {
         if (!isset($origin[$name]) || $state->replaceDuplicateLinks()) {
             $this->logger->info("Merging <comment>{$name}</comment>");
             $origin[$name] = $link;
         } else {
             // Defer to solver.
             $this->logger->info("Deferring duplicate <comment>{$name}</comment>");
             $dups[] = $link;
         }
     }
     $state->addDuplicateLinks($type, $dups);
     return $origin;
 }
All Usage Examples Of Wikimedia\Composer\Merge\PluginState::addDuplicateLinks