protected function manipulateRootPackage(array $packages, int $type, array $requires): array
    {
        if ($type === self::ADD) {
            foreach ($packages as $packageName => $version) {
                $requires[$packageName] = new Link(
                    '__root__',
                    $packageName,
                    (new VersionParser())->parseConstraints($version),
                    'relates to',
                    $version
                );
            }
        } elseif ($type === self::REMOVE) {
            foreach ($packages as $packageName => $version) {
                unset($requires[$packageName]);
            }
        }

        return $requires;
    }
protected function manipulateRootPackage(array $packages, int $type, array $requires): array
    {
        if ($type === self::ADD) {
            foreach ($packages as $packageName => $version) {
                $requires[$packageName] = new Link(
                    '__root__',
                    $packageName,
                    (new VersionParser())->parseConstraints($version),
                    'relates to',
                    $version
                );
            }
        } elseif ($type === self::REMOVE) {
            foreach ($packages as $packageName => $version) {
                unset($requires[$packageName]);
            }
        }

        return $requires;
    }
protected function manipulateRootPackage ( array $ packages , int $ type , array $ requires ) : array { if ( $ type === self :: ADD ) { foreach ( $ packages as $ packageName => $ version ) { $ requires [ $ packageName ] = new Link ( '__root__' , $ packageName , ( new VersionParser ( ) ) -> parseConstraints ( $ version ) , 'relates to' , $ version ) ; } } elseif ( $ type === self :: REMOVE ) { foreach ( $ packages as $ packageName => $ version ) { unset ( $ requires [ $ packageName ] ) ; } } return $ requires ; }
Manipulates the given requires with the new added packages.

@param array $packages
@param int   $type
@param array $requires

@return array
Manipulates the given requires with the new added packages .