public static function unwrapIfNeeded(
        RootPackageInterface $root,
        $method = 'setExtra'
    ) {
        // @codeCoverageIgnoreStart
        if ($root instanceof RootAliasPackage &&
            !method_exists($root, $method)
        ) {
            // Unwrap and return the aliased RootPackage.
            $root = $root->getAliasOf();
        }
        // @codeCoverageIgnoreEnd
        return $root;
    }
public static function unwrapIfNeeded(
        RootPackageInterface $root,
        $method = 'setExtra'
    ) {
        // @codeCoverageIgnoreStart
        if ($root instanceof RootAliasPackage &&
            !method_exists($root, $method)
        ) {
            // Unwrap and return the aliased RootPackage.
            $root = $root->getAliasOf();
        }
        // @codeCoverageIgnoreEnd
        return $root;
    }
public static function unwrapIfNeeded ( RootPackageInterface $ root , $ method = 'setExtra' ) { // @codeCoverageIgnoreStart if ( $ root instanceof RootAliasPackage && ! method_exists ( $ root , $ method ) ) { // Unwrap and return the aliased RootPackage. $ root = $ root -> getAliasOf ( ) ; } // @codeCoverageIgnoreEnd return $ root ; }
Get a full featured Package from a RootPackageInterface.

In Composer versions before 599ad77 the RootPackageInterface only
defines a sub-set of operations needed by composer-merge-plugin and
RootAliasPackage only implemented those methods defined by the
interface. Most of the unimplemented methods in RootAliasPackage can be
worked around because the getter methods that are implemented proxy to
the aliased package which we can modify by unwrapping. The exception
being modifying the 'conflicts', 'provides' and 'replaces' collections.
We have no way to actually modify those collections unfortunately in
older versions of Composer.

@param RootPackageInterface $root
@param string $method Method needed
@return RootPackageInterface|RootPackage
Get a full featured Package from a RootPackageInterface .