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

Breadcrumb

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

function RuleSetGenerator::createMultiConflictRule

@phpstan-param ReasonData $reasonData

Parameters

non-empty-array<BasePackage> $packages:

Rule::RULE_* $reason A RULE_* constant:

mixed $reasonData:

1 call to RuleSetGenerator::createMultiConflictRule()
RuleSetGenerator::addConflictRules in vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php

File

vendor/composer/composer/src/Composer/DependencyResolver/RuleSetGenerator.php, line 129

Class

RuleSetGenerator
@author Nils Adermann <naderman@naderman.de> @phpstan-import-type ReasonData from Rule

Namespace

Composer\DependencyResolver

Code

protected function createMultiConflictRule(array $packages, $reason, $reasonData) : Rule {
    $literals = [];
    foreach ($packages as $package) {
        $literals[] = -$package->id;
    }
    if (\count($literals) === 2) {
        return new Rule2Literals($literals[0], $literals[1], $reason, $reasonData);
    }
    return new MultiConflictRule($literals, $reason, $reasonData);
}

API Navigation

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