From 73080490564b75882b2457cda4cc38de4ab6c18f Mon Sep 17 00:00:00 2001 From: Paul Seiffert Date: Tue, 8 May 2012 23:06:10 +0200 Subject: [PATCH] Added removePackage() to Repository\RepositoryInterface in order to provide to be able to rely on the existance of this method in all repositories. Had to add this method to the Repository\CompositeRepository. --- src/Composer/Repository/CompositeRepository.php | 11 +++++++++++ src/Composer/Repository/RepositoryInterface.php | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/src/Composer/Repository/CompositeRepository.php b/src/Composer/Repository/CompositeRepository.php index e000d97e8..b01f2e7ca 100644 --- a/src/Composer/Repository/CompositeRepository.php +++ b/src/Composer/Repository/CompositeRepository.php @@ -91,6 +91,17 @@ class CompositeRepository implements RepositoryInterface return call_user_func_array('array_merge', $packages); } + /** + * {@inheritdoc} + */ + public function removePackage(PackageInterface $package) + { + foreach($this->repositories as $repository) { + /* @var $repository RepositoryInterface */ + $repository->removePackage($package); + } + } + /** * {@inheritdoc} */ diff --git a/src/Composer/Repository/RepositoryInterface.php b/src/Composer/Repository/RepositoryInterface.php index e4a79695d..de735c039 100644 --- a/src/Composer/Repository/RepositoryInterface.php +++ b/src/Composer/Repository/RepositoryInterface.php @@ -57,4 +57,11 @@ interface RepositoryInterface extends \Countable * @return array */ function getPackages(); + + /** + * @abstract + * @param \Composer\Package\PackageInterface $package + * @return void + */ + function removePackage(PackageInterface $package); }