* * 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:----ObMt4RLLhdZgHVhvygtFfLcp3W82oC7W5pl5tH6hMpYE9x//33ANltHi1GkJdu9Z2UYNV7XCf1V2J4jOhIbWLwVh8cqfv9Xhe9+Y+s8IhbGvSBjMhvCnYEc5sLEyr9vVGPi1lndqy5Ltp3fiKtwtj4lBJ3cYY2FVTSsM6+BytS+Lk9WuM+cZTxtPQ4ebnb3Wrs+WcsTq5rzNDPgriq1xZgrGm7+QUkMc1BG+TJwOa5RXt6yB1jgCOt0r2cBSVuCyiqfvhmOuHzem2fG0z6R9wIq74KtggEo5Ua6+lLHVb0DaU9SMWT7PXHZABDwNN9pAOdkUiMIfjGcUfHkpszJWh7iyEh7GmKQE9Z75WCb6L6BaRIEsLUWZhCY0cH1R5YLY41+FqoWvsNrd1fv4hYJRpFC+GxrE+uwCTxzJsf5Yy1hkWlw3XcmKhmQwJXCF9+wcjadK67r4iJMs+pAjvdVfNJ/nwrLSyiDBDCNILQfOpJwY2fLjB6ahCiMukupv29f4YJr0zCvPR5HHYJ1L15wVgUxpDw6hAzLIx36MSH489R006pavOwt/P1Y3+vRzYlPBmIwct3K1fW0w0TeFTG0u8/CLSYDXxWiFHVlUn0rQL91zFmkIBuLXG1fM26nmodCLWZmiOtlgRhaSTzcflPvZLRGXIFvD39tg+soPruL9eh4=----ATTACHMENT:----MTE5ODIwNDY5MTM0MzcxMCA2NTgzMTM4NzQ2MTUyODIgMjEwODg1NTQ0MTAzOTkxMQ==