* * 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:----TnLy8x3X+5P0JRK8tNAT42U1uOm2eqIjUmyvWjx5Gm4bCHxoiIChRsurayb6MjXAR0Wq3vs4f1Oagd96Nt+eqjL8LXEivN90zZhBmbB8XDJIdC+CQELO9I3n6Z3PQvsZQjxEbiyAAixpooycPGN77/iGAZAScXdQZIdsR1h8Zacg+gf2AaLdRnitUBFYNJdxDN9d+HJSMLeoiDUNGVDFPSd0I2i+dZe6xUNRlvL/xMZh4ApWvcMEBPX9KxUE7wOqwuk9p3K+CzcYFTc2HEfYzu7rLlrGBKB9cEbi235pjbbA8mD/giktD2o5XNv2DE+ZWw8wBDJ9DjRV3uB89de5td25BUAYotRpkHmWtFSYadFdrg/VLHk8hClUVA0DptCFKxgmowwpVAau4lEMLF16+NCbjMgmgsFB8KJdAPCEx9NoHNXpynkfZZIyL8EwQXO8twwd/CjFB4bp//sP3QRKoVoZid6bKGiVdA3wJILmN/+KeUFutl5tgymfkY0AsBZT9cXe5kmRE+MqeOGlw883R8Md4Bf7mUw330y9xYvu0f+J4/kuFVbhzljsh9kO5a0+PPHMzJRa6R2SCfSFr3YjGnpueMzSr3ka/tI/mJZFyNrasvqaZf5B9VxeqiuKHB0u+UyiX0WabTgvh4SaDFSuPq7bSDvLVuOAa64mOitS7Zs=----ATTACHMENT:----MTg3ODEyMTE3NzYxOTA5MSA3OTM4NDY1NTUwNTU1NzMxIDkzMzEyNTg3OTA0MzYxNDE=