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

Breadcrumb

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

function Problem::getRulePriority

1 call to Problem::getRulePriority()
Problem::getPrettyString in vendor/composer/composer/src/Composer/DependencyResolver/Problem.php
A human readable textual representation of the problem's reasons

File

vendor/composer/composer/src/Composer/DependencyResolver/Problem.php, line 135

Class

Problem
Represents a problem detected while solving dependencies

Namespace

Composer\DependencyResolver

Code

private function getRulePriority(Rule $rule) : int {
    switch ($rule->getReason()) {
        case Rule::RULE_FIXED:
            return 3;
        case Rule::RULE_ROOT_REQUIRE:
            return 2;
        case Rule::RULE_PACKAGE_CONFLICT:
        case Rule::RULE_PACKAGE_REQUIRES:
            return 1;
        case Rule::RULE_PACKAGE_SAME_NAME:
        case Rule::RULE_LEARNED:
        case Rule::RULE_PACKAGE_ALIAS:
        case Rule::RULE_PACKAGE_INVERSE_ALIAS:
            return 0;
    }
    throw new \LogicException('Unknown rule type: ' . $rule->getReason());
}

API Navigation

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