Parcourir la source

Remove duplicate function from decisions

Nils Adermann il y a 13 ans
Parent
commit
76f8642feb

+ 0 - 10
src/Composer/DependencyResolver/Decisions.php

@@ -46,16 +46,6 @@ class Decisions implements \Iterator, \Countable
         );
     }
 
-    public function contain($literal)
-    {
-        $packageId = abs($literal);
-
-        return (
-            $this->decisionMap[$packageId] > 0 && $literal > 0 ||
-            $this->decisionMap[$packageId] < 0 && $literal < 0
-        );
-    }
-
     public function satisfy($literal)
     {
         $packageId = abs($literal);

+ 1 - 1
src/Composer/DependencyResolver/RuleWatchGraph.php

@@ -94,7 +94,7 @@ class RuleWatchGraph
             $node = $chain->current();
             $otherWatch = $node->getOtherWatch($literal);
 
-            if (!$node->getRule()->isDisabled() && !$decisions->contain($otherWatch)) {
+            if (!$node->getRule()->isDisabled() && !$decisions->satisfy($otherWatch)) {
                 $ruleLiterals = $node->getRule()->getLiterals();
 
                 $alternativeLiterals = array_filter($ruleLiterals, function ($ruleLiteral) use ($literal, $otherWatch, $decisions) {