protected function mergeRequires(RootPackageInterface $root, PluginState $state)
    {
        if ( ! empty($requires = $this->getPackage()->getRequires())) {
            $this->mergeStabilityFlags($root, $requires);

            $duplicateLinks = [];
            $requires       = $this->replaceSelfVersionDependencies(
                'require', $requires, $root
            );

            $root->setRequires($this->mergeLinks(
                $root->getRequires(), $requires, $state, $duplicateLinks
            ));

            $state->addDuplicateLinks('require', $duplicateLinks);
        }
    }