src/Plugin/Patches.php
protected function getPackageFromOperation(OperationInterface $operation)
    {
        if ($operation instanceof InstallOperation) {
            $package = $operation->getPackage();
        } elseif ($operation instanceof UpdateOperation) {
            $package = $operation->getTargetPackage();
        } else {
            throw new \Exception('Unknown operation: ' . get_class($operation));
        }

        return $package;
    }
protected function getPackageFromOperation(OperationInterface $operation)
    {
        if ($operation instanceof InstallOperation) {
            $package = $operation->getPackage();
        } elseif ($operation instanceof UpdateOperation) {
            $package = $operation->getTargetPackage();
        } else {
            throw new \Exception('Unknown operation: ' . get_class($operation));
        }

        return $package;
    }
protected function getPackageFromOperation ( OperationInterface $ operation ) { if ( $ operation instanceof InstallOperation ) { $ package = $ operation -> getPackage ( ) ; } elseif ( $ operation instanceof UpdateOperation ) { $ package = $ operation -> getTargetPackage ( ) ; } else { throw new \ Exception ( 'Unknown operation: ' . get_class ( $ operation ) ) ; } return $ package ; }
Get a Package object from an OperationInterface object.

@param OperationInterface $operation
@return PackageInterface
@throws \Exception
Get a Package object from an OperationInterface object .