Преглед изворни кода

Merge pull request #7458 from staabm/patch-3

Define variable only when actually used
Rob пре 6 година
родитељ
комит
7079cdb70d
1 измењених фајлова са 1 додато и 2 уклоњено
  1. 1 2
      src/Composer/DependencyResolver/Solver.php

+ 1 - 2
src/Composer/DependencyResolver/Solver.php

@@ -510,9 +510,8 @@ class Solver
      */
     private function analyzeUnsolvableRule(Problem $problem, Rule $conflictRule)
     {
-        $why = spl_object_hash($conflictRule);
-
         if ($conflictRule->getType() == RuleSet::TYPE_LEARNED) {
+            $why = spl_object_hash($conflictRule);
             $learnedWhy = $this->learnedWhy[$why];
             $problemRules = $this->learnedPool[$learnedWhy];