From 9338401be7a09c4c740b74aad6f10bdcf93a096d Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 21 Oct 2020 18:11:24 +0200 Subject: [PATCH] CS: Typehint array, remove unnecessary docblock, call spl_object_hash once --- src/Composer/DependencyResolver/Solver.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Composer/DependencyResolver/Solver.php b/src/Composer/DependencyResolver/Solver.php index 35b97e6ae..9a9190dbe 100644 --- a/src/Composer/DependencyResolver/Solver.php +++ b/src/Composer/DependencyResolver/Solver.php @@ -514,16 +514,12 @@ class Solver return array($learnedLiterals[0], $ruleLevel, $newRule, $why); } - /** - * @param Problem $problem - * @param Rule $conflictRule - */ - private function analyzeUnsolvableRule(Problem $problem, Rule $conflictRule, &$ruleSeen) + private function analyzeUnsolvableRule(Problem $problem, Rule $conflictRule, array &$ruleSeen) { - $ruleSeen[spl_object_hash($conflictRule)] = true; + $why = spl_object_hash($conflictRule); + $ruleSeen[$why] = true; if ($conflictRule->getType() == RuleSet::TYPE_LEARNED) { - $why = spl_object_hash($conflictRule); $learnedWhy = $this->learnedWhy[$why]; $problemRules = $this->learnedPool[$learnedWhy];