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

Breadcrumb

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

function RuleSetGenerator::createRule2Literals

Creates a rule for two conflicting packages

The rule for conflicting packages A and B is (-A|-B). A is called the issuer and B the provider.

@phpstan-param ReasonData $reasonData

Parameters

BasePackage $issuer The package declaring the conflict:

BasePackage $provider The package causing the conflict:

Rule::RULE_* $reason A RULE_* constant describing the reason for generating this rule:

mixed $reasonData Any data, e.g. the package name, that goes with the reason:

Return value

?Rule The generated rule

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

File

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

Class

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

Namespace

Composer\DependencyResolver

Code

protected function createRule2Literals(BasePackage $issuer, BasePackage $provider, $reason, $reasonData) : ?Rule {
    // ignore self conflict
    if ($issuer === $provider) {
        return null;
    }
    return new Rule2Literals(-$issuer->id, -$provider->id, $reason, $reasonData);
}

API Navigation

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