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\DependencyResolverCode
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;
}
}