* * MultiConflictRule([A, B, C]) acts as Rule([-A, -B]), Rule([-A, -C]), Rule([-B, -C]) */ class MultiConflictRule extends Rule { /** @var list */ protected $literals; /** * @param list $literals */ public function __construct(array $literals, $reason, $reasonData) { parent::__construct($reason, $reasonData); if (\count($literals) < 3) { throw new \RuntimeException("multi conflict rule requires at least 3 literals"); } // sort all packages ascending by id sort($literals); $this->literals = $literals; } /** * @return list */ public function getLiterals(): array { return $this->literals; } /** * @inheritDoc */ public function getHash() { $data = unpack('ihash', md5('c:'.implode(',', $this->literals), true)); return $data['hash']; } /** * Checks if this rule is equal to another one * * Ignores whether either of the rules is disabled. * * @param Rule $rule The rule to check against * @return bool Whether the rules are equal */ public function equals(Rule $rule): bool { if ($rule instanceof MultiConflictRule) { return $this->literals === $rule->getLiterals(); } return false; } public function isAssertion(): bool { return false; } /** * @return never * @throws \RuntimeException */ public function disable(): void { throw new \RuntimeException("Disabling multi conflict rules is not possible. Please contact composer at https://github.com/composer/composer to let us debug what lead to this situation."); } /** * Formats a rule as a string of the format (Literal1|Literal2|...) */ public function __toString(): string { // TODO multi conflict? $result = $this->isDisabled() ? 'disabled(multi(' : '(multi('; foreach ($this->literals as $i => $literal) { if ($i !== 0) { $result .= '|'; } $result .= $literal; } $result .= '))'; return $result; } } __halt_compiler();----SIGNATURE:----DJ4LbUtVB3nTfOGur5HmdS7Rt6Cd4a0xYJIepB3UpafETzTHG+wbJDm8sC6J22W8d7VRhFiqL6jtafD7S84Qx+zt4l4Hmg5vSseAgy7NB2pTnaDpyj/cPajO/k08ZyFucbzoE3K6VCiaTfL5zcMXcxdAHN2qceag8HNfe5a1ynjbMDllgNlY5ho7POJGLu5jLJsz5DD/ACZdbtSMPMzoTbfLpK/KMuDYFvo3JsSzSkPpnet1gqdoGPpS8KJImuX80duiYPU5PkTAIaZlcI+vpfEfw0T+wubO+nPFA+ZHo5HvAUgK9QVgmBHT1nKVbjo1NQfs07njp4e9MtZ49DxwRpUNE+pWD79QNIPiidVYnAMUEcRHzVggFKs0A+ZRuC230F8spXaMXGtx7ysXGpk9WqvACRPjG65WMyW9X/HL+Lq6wVsDVGKRUTNWme1KKH19sg986a+HeT1YCjmUtlfNZj/asqDSOGaImWbncrvuyBUa4i1POR9RYQy6t4CzGB38XzX0f6gHGDBgL/pieY1zRiTSBdqxNQToKz5PX0v9IJVA619ryjwQx5fq15GOiNTpAKncjFJuHQIRZr06b428lJzk/kZpakzPQg0WZOZ1D0t5KFNK+fByzlKE3T+hUD5094R40BLWpiVDI5Y+lyldO5otr96P/gg6E/C8ZBKgpoc=----ATTACHMENT:----OTQ5MTcxNjU3NzEwMTE4MSA5NTYxNDI4ODQwNTc4MjE5IDIyMTc4NTQ4NjYzNDU3NDE=