* * MultiConflictRule([A, B, C]) acts as Rule([-A, -B]), Rule([-A, -C]), Rule([-B, -C]) */ class MultiConflictRule extends Rule { /** @var non-empty-list */ protected $literals; /** * @param non-empty-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 non-empty-list */ public function getLiterals(): array { return $this->literals; } /** * @inheritDoc */ public function getHash() { $data = unpack('ihash', (string) hash(\PHP_VERSION_ID > 80100 ? 'xxh3' : 'sha1', 'c:'.implode(',', $this->literals), true)); if (false === $data) { throw new \RuntimeException('Failed unpacking: '.implode(', ', $this->literals)); } 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:----py9EVRmXsUL/OA5+z26VLZoPzP81N5lb0Cufvud7OctX40w/Xhd1rmRiCsGBQ7V9Nc5xWnRgFJjdhBl+411ofgT/BwDbDQ33Hck2+D0xOMzT2rwawSTesvWdX785cOKm7Vdc1Q5Im2VzV6/cusJ61jK9NJW8NUM7BDh+Tdv8Lo/yppre/fdSxP4oEHsoaLYNZWz2PSKZfnNcf0BgjnNCBcXXF33PB0GS4ERcRGYWt7I655IXN3qYovKzXJO8QVDou/PnKAncjjzYlgSBqgvaeEhQ69xtLNyVYUkgy5QTb5VS8LoEfTzyrnZlDwPFJU/nM7i5x1cvJegbWE4ZLEz8E0cUkC5jTs55J0lPF5dfxID7mI5xzHHZooIPacmP+lSWvOhz2JCO3Yl6S7vMQN3q08qiMS5QsgUWWI80MI+WodmHeP/Bxzj7QbeoZY+5RayWczlM8kOE5qSaIdoWoCL7AmVqSwtD491YgnSWX45fi98AMAD5lnq0FjI7pAJvX/HPJRSZ2FzV7oC9sI//csJGPKnWycx3KS52FNzZwTuDEMS5Pmy+uDY1IFcxmNj/PwBlj8CiG4OEI8hMEA2UwLHU4qQ9VP55jmf1kO7qbdJorIJUbkTeboWCq2bNcNP0h675plq//Hay0dMvaEZgijFsbizs30oRCiwzBI52kkmoUYU=----ATTACHMENT:----NjQ0MzcxNDU3ODU1ODEwIDc5MTA1ODM3NDI1NjkwNzkgMjE4NTYwNDc3NDQ5MzI5OA==