shouldMergeExtraDeep() public method

By default the extra section is merged with array_merge() and duplicate keys are ignored. When enabled this allows to merge the arrays recursively using the following rule: Integer keys are merged, while array values are replaced where the later values overwrite the former. This is useful especially for the extra section when plugins use larger structures like a 'patches' key with the packages as sub-keys and the patches as values. When 'replace' mode is activated the order of array merges is exchanged.
public shouldMergeExtraDeep ( ) : boolean
return boolean
 /**
  * Merge extra config into a RootPackageInterface
  *
  * @param RootPackageInterface $root
  * @param PluginState $state
  */
 public function mergeExtra(RootPackageInterface $root, PluginState $state)
 {
     $extra = $this->package->getExtra();
     unset($extra['merge-plugin']);
     if (!$state->shouldMergeExtra() || empty($extra)) {
         return;
     }
     $rootExtra = $root->getExtra();
     $unwrapped = self::unwrapIfNeeded($root, 'setExtra');
     if ($state->replaceDuplicateLinks()) {
         $unwrapped->setExtra(self::mergeExtraArray($state->shouldMergeExtraDeep(), $rootExtra, $extra));
     } else {
         if (!$state->shouldMergeExtraDeep()) {
             foreach (array_intersect(array_keys($extra), array_keys($rootExtra)) as $key) {
                 $this->logger->info("Ignoring duplicate <comment>{$key}</comment> in " . "<comment>{$this->path}</comment> extra config.");
             }
         }
         $unwrapped->setExtra(self::mergeExtraArray($state->shouldMergeExtraDeep(), $extra, $rootExtra));
     }
 }