Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Decisions.php

function Decisions::addDecision

1 call to Decisions::addDecision()
Decisions::decide in vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php

File

vendor/composer/composer/src/Composer/DependencyResolver/Decisions.php, line 196

Class

Decisions
Stores decisions on installing, removing or keeping packages

Namespace

Composer\DependencyResolver

Code

protected function addDecision(int $literal, int $level) : void {
    $packageId = abs($literal);
    $previousDecision = $this->decisionMap[$packageId] ?? 0;
    if ($previousDecision !== 0) {
        $literalString = $this->pool
            ->literalToPrettyString($literal, []);
        $package = $this->pool
            ->literalToPackage($literal);
        throw new SolverBugException("Trying to decide {$literalString} on level {$level}, even though {$package} was previously decided as " . $previousDecision . ".");
    }
    if ($literal > 0) {
        $this->decisionMap[$packageId] = $level;
    }
    else {
        $this->decisionMap[$packageId] = -$level;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal