src/Composer/Plugin.php
protected function getDrupalPackage($operation)
    {
        if ($operation instanceof InstallOperation) {
            $package = $operation->getPackage();
        } elseif ($operation instanceof UpdateOperation) {
            $package = $operation->getTargetPackage();
        }
        if ($this->isDrupalPackage($package)) {
            return $package;
        }
        return null;
    }
protected function getDrupalPackage($operation)
    {
        if ($operation instanceof InstallOperation) {
            $package = $operation->getPackage();
        } elseif ($operation instanceof UpdateOperation) {
            $package = $operation->getTargetPackage();
        }
        if ($this->isDrupalPackage($package)) {
            return $package;
        }
        return null;
    }
protected function getDrupalPackage ( $ operation ) { if ( $ operation instanceof InstallOperation ) { $ package = $ operation -> getPackage ( ) ; } elseif ( $ operation instanceof UpdateOperation ) { $ package = $ operation -> getTargetPackage ( ) ; } if ( $ this -> isDrupalPackage ( $ package ) ) { return $ package ; } return null ; }
Gets the package if it is a Drupal related package.

@param $operation

@return mixed
If the package is a Drupal package, it will be returned. Otherwise, NULL.
Gets the package if it is a Drupal related package .