public function mergeScripts(RootPackageInterface $root, PluginState $state)
    {
        $scripts = $this->package->getScripts();
        if (!$state->shouldMergeScripts() || empty($scripts)) {
            return;
        }

        $rootScripts = $root->getScripts();
        $unwrapped = self::unwrapIfNeeded($root, 'setScripts');

        if ($state->replaceDuplicateLinks()) {
            $unwrapped->setScripts(
                array_merge($rootScripts, $scripts)
            );
        } else {
            $unwrapped->setScripts(
                array_merge($scripts, $rootScripts)
            );
        }
    }
public function mergeScripts(RootPackageInterface $root, PluginState $state)
    {
        $scripts = $this->package->getScripts();
        if (!$state->shouldMergeScripts() || empty($scripts)) {
            return;
        }

        $rootScripts = $root->getScripts();
        $unwrapped = self::unwrapIfNeeded($root, 'setScripts');

        if ($state->replaceDuplicateLinks()) {
            $unwrapped->setScripts(
                array_merge($rootScripts, $scripts)
            );
        } else {
            $unwrapped->setScripts(
                array_merge($scripts, $rootScripts)
            );
        }
    }
public function mergeScripts ( RootPackageInterface $ root , PluginState $ state ) { $ scripts = $ this -> package -> getScripts ( ) ; if ( ! $ state -> shouldMergeScripts ( ) || empty ( $ scripts ) ) { return ; } $ rootScripts = $ root -> getScripts ( ) ; $ unwrapped = self :: unwrapIfNeeded ( $ root , 'setScripts' ) ; if ( $ state -> replaceDuplicateLinks ( ) ) { $ unwrapped -> setScripts ( array_merge ( $ rootScripts , $ scripts ) ) ; } else { $ unwrapped -> setScripts ( array_merge ( $ scripts , $ rootScripts ) ) ; } }
Merge scripts config into a RootPackageInterface

@param RootPackageInterface $root
@param PluginState $state
Merge scripts config into a RootPackageInterface