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

Breadcrumb

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

function Problem::addReason

Store a reason descriptor but ignore duplicates

Parameters

string $id A canonical identifier for the reason:

Rule $reason The reason descriptor:

1 call to Problem::addReason()
Problem::addRule in vendor/composer/composer/src/Composer/DependencyResolver/Problem.php
Add a rule as a reason

File

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

Class

Problem
Represents a problem detected while solving dependencies

Namespace

Composer\DependencyResolver

Code

protected function addReason(string $id, Rule $reason) : void {
    // TODO: if a rule is part of a problem description in two sections, isn't this going to remove a message
    // that is important to understand the issue?
    if (!isset($this->reasonSeen[$id])) {
        $this->reasonSeen[$id] = true;
        $this->reasons[$this->section][] = $reason;
    }
}

API Navigation

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