소스 검색

Define variable only when actually used

Markus Staab 6 년 전
부모
커밋
86d5de2965
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];