From 9b8ab7d7100b61be70dfba0f48d122db0523ae86 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 18 Apr 2011 22:47:33 +0200 Subject: [PATCH] Fix SpecificConstraint which only handles matching of instances of same constraint --- .../Package/LinkConstraint/SpecificConstraint.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Composer/Package/LinkConstraint/SpecificConstraint.php b/src/Composer/Package/LinkConstraint/SpecificConstraint.php index 49235dcaf..1c63821c2 100644 --- a/src/Composer/Package/LinkConstraint/SpecificConstraint.php +++ b/src/Composer/Package/LinkConstraint/SpecificConstraint.php @@ -17,21 +17,21 @@ namespace Composer\Package\LinkConstraint; * * @author Nils Adermann */ -class SpecificConstraint implements LinkConstraintInterface +abstract class SpecificConstraint implements LinkConstraintInterface { public function matches(LinkConstraintInterface $provider) { if ($provider instanceof MultiConstraint) { // turn matching around to find a match return $provider->matches($this); - } else if ($provider instanceof get_class($this)) { + } else if ($provider instanceof $this) { return $this->matchSpecific($provider); } return true; } - abstract public function matchSpecific($provider); - - abstract public function __toString(); + // implementations must implement a method of this format: + // not declared abstract here because type hinting violates parameter coherence (TODO right word?) + // public function matchSpecific( $provider); }