src/Composer/DependencyResolver/Solver.php
private function makeAssertionRuleDecisions()
    {
        $decisionStart = count($this->decisions) - 1;

        $rulesCount = count($this->rules);
        for ($ruleIndex = 0; $ruleIndex < $rulesCount; $ruleIndex++) {
            $rule = $this->rules->ruleById[$ruleIndex];

            if (!$rule->isAssertion() || $rule->isDisabled()) {
                continue;
            }

            $literals = $rule->getLiterals();
            $literal = $literals[0];

            if (!$this->decisions->decided($literal)) {
                $this->decisions->decide($literal, 1, $rule);
                continue;
            }

            if ($this->decisions->satisfy($literal)) {
                continue;
            }

            // found a conflict
            if (RuleSet::TYPE_LEARNED === $rule->getType()) {
                $rule->disable();
                continue;
            }

            $conflict = $this->decisions->decisionRule($literal);

            if ($conflict && RuleSet::TYPE_PACKAGE === $conflict->getType()) {
                $problem = new Problem($this->pool);

                $problem->addRule($rule);
                $problem->addRule($conflict);
                $this->disableProblem($rule);
                $this->problems[] = $problem;
                continue;
            }

            // conflict with another job
            $problem = new Problem($this->pool);
            $problem->addRule($rule);
            $problem->addRule($conflict);

            // push all of our rules (can only be job rules)
            // asserting this literal on the problem stack
            foreach ($this->rules->getIteratorFor(RuleSet::TYPE_JOB) as $assertRule) {
                if ($assertRule->isDisabled() || !$assertRule->isAssertion()) {
                    continue;
                }

                $assertRuleLiterals = $assertRule->getLiterals();
                $assertRuleLiteral = $assertRuleLiterals[0];

                if (abs($literal) !== abs($assertRuleLiteral)) {
                    continue;
                }

                $problem->addRule($assertRule);
                $this->disableProblem($assertRule);
            }
            $this->problems[] = $problem;

            $this->decisions->resetToOffset($decisionStart);
            $ruleIndex = -1;
        }
    }
private function makeAssertionRuleDecisions()
    {
        $decisionStart = count($this->decisions) - 1;

        $rulesCount = count($this->rules);
        for ($ruleIndex = 0; $ruleIndex < $rulesCount; $ruleIndex++) {
            $rule = $this->rules->ruleById[$ruleIndex];

            if (!$rule->isAssertion() || $rule->isDisabled()) {
                continue;
            }

            $literals = $rule->getLiterals();
            $literal = $literals[0];

            if (!$this->decisions->decided($literal)) {
                $this->decisions->decide($literal, 1, $rule);
                continue;
            }

            if ($this->decisions->satisfy($literal)) {
                continue;
            }

            // found a conflict
            if (RuleSet::TYPE_LEARNED === $rule->getType()) {
                $rule->disable();
                continue;
            }

            $conflict = $this->decisions->decisionRule($literal);

            if ($conflict && RuleSet::TYPE_PACKAGE === $conflict->getType()) {
                $problem = new Problem($this->pool);

                $problem->addRule($rule);
                $problem->addRule($conflict);
                $this->disableProblem($rule);
                $this->problems[] = $problem;
                continue;
            }

            // conflict with another job
            $problem = new Problem($this->pool);
            $problem->addRule($rule);
            $problem->addRule($conflict);

            // push all of our rules (can only be job rules)
            // asserting this literal on the problem stack
            foreach ($this->rules->getIteratorFor(RuleSet::TYPE_JOB) as $assertRule) {
                if ($assertRule->isDisabled() || !$assertRule->isAssertion()) {
                    continue;
                }

                $assertRuleLiterals = $assertRule->getLiterals();
                $assertRuleLiteral = $assertRuleLiterals[0];

                if (abs($literal) !== abs($assertRuleLiteral)) {
                    continue;
                }

                $problem->addRule($assertRule);
                $this->disableProblem($assertRule);
            }
            $this->problems[] = $problem;

            $this->decisions->resetToOffset($decisionStart);
            $ruleIndex = -1;
        }
    }
private function makeAssertionRuleDecisions ( ) { $ decisionStart = count ( $ this -> decisions ) - 1 ; $ rulesCount = count ( $ this -> rules ) ; for ( $ ruleIndex = 0 ; $ ruleIndex < $ rulesCount ; $ ruleIndex ++ ) { $ rule = $ this -> rules -> ruleById [ $ ruleIndex ] ; if ( ! $ rule -> isAssertion ( ) || $ rule -> isDisabled ( ) ) { continue ; } $ literals = $ rule -> getLiterals ( ) ; $ literal = $ literals [ 0 ] ; if ( ! $ this -> decisions -> decided ( $ literal ) ) { $ this -> decisions -> decide ( $ literal , 1 , $ rule ) ; continue ; } if ( $ this -> decisions -> satisfy ( $ literal ) ) { continue ; } // found a conflict if ( RuleSet :: TYPE_LEARNED === $ rule -> getType ( ) ) { $ rule -> disable ( ) ; continue ; } $ conflict = $ this -> decisions -> decisionRule ( $ literal ) ; if ( $ conflict && RuleSet :: TYPE_PACKAGE === $ conflict -> getType ( ) ) { $ problem = new Problem ( $ this -> pool ) ; $ problem -> addRule ( $ rule ) ; $ problem -> addRule ( $ conflict ) ; $ this -> disableProblem ( $ rule ) ; $ this -> problems [ ] = $ problem ; continue ; } // conflict with another job $ problem = new Problem ( $ this -> pool ) ; $ problem -> addRule ( $ rule ) ; $ problem -> addRule ( $ conflict ) ; // push all of our rules (can only be job rules) // asserting this literal on the problem stack foreach ( $ this -> rules -> getIteratorFor ( RuleSet :: TYPE_JOB ) as $ assertRule ) { if ( $ assertRule -> isDisabled ( ) || ! $ assertRule -> isAssertion ( ) ) { continue ; } $ assertRuleLiterals = $ assertRule -> getLiterals ( ) ; $ assertRuleLiteral = $ assertRuleLiterals [ 0 ] ; if ( abs ( $ literal ) !== abs ( $ assertRuleLiteral ) ) { continue ; } $ problem -> addRule ( $ assertRule ) ; $ this -> disableProblem ( $ assertRule ) ; } $ this -> problems [ ] = $ problem ; $ this -> decisions -> resetToOffset ( $ decisionStart ) ; $ ruleIndex = - 1 ; } }
aka solver_makeruledecisions
aka solver_makeruledecisions