* @phpstan-import-type ReasonData from Rule */ class Rule2Literals extends Rule { /** @var int */ protected $literal1; /** @var int */ protected $literal2; /** * @param Rule::RULE_* $reason A RULE_* constant * @param mixed $reasonData * * @phpstan-param ReasonData $reasonData */ public function __construct(int $literal1, int $literal2, $reason, $reasonData) { parent::__construct($reason, $reasonData); if ($literal1 < $literal2) { $this->literal1 = $literal1; $this->literal2 = $literal2; } else { $this->literal1 = $literal2; $this->literal2 = $literal1; } } /** * @return list */ public function getLiterals(): array { return [$this->literal1, $this->literal2]; } /** * @inheritDoc */ public function getHash() { return $this->literal1.','.$this->literal2; } /** * 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 self) { if ($this->literal1 !== $rule->literal1) { return false; } if ($this->literal2 !== $rule->literal2) { return false; } return true; } $literals = $rule->getLiterals(); if (2 !== \count($literals)) { return false; } if ($this->literal1 !== $literals[0]) { return false; } if ($this->literal2 !== $literals[1]) { return false; } return true; } /** * @return false */ public function isAssertion(): bool { return false; } /** * Formats a rule as a string of the format (Literal1|Literal2|...) */ public function __toString(): string { $result = $this->isDisabled() ? 'disabled(' : '('; $result .= $this->literal1 . '|' . $this->literal2 . ')'; return $result; } } __halt_compiler();----SIGNATURE:----HlVMypwq8feDLspvJu+nAXT3/Nushf1hWRS3GT5PzWShyZ93jwwLZsR1X34+w1AJyDv88oq2PInOJs3/exqKTFZpJE9mVERsouxYq72pd7/IAfs4vzeh+1gLic1cO2yaMrlH94JcM6zMH+m3QlJ2YIAyphEvKh8R6uUOJHM64vBTkH75/ecAYM1LBvOtF11F/ZUbPDWl23uyjfGwvRfnsS036m+9QpRoptJ7aLhJ28wFXFG7Bc2B1BcuZpLjB9xoQJOnlMUNlKIOFIqNeXUPiUm1eBeRwedQ6WHzFIcbdnnWdGqDEzPqKWklK7KqBgOMmHwl+/zJkCri3coMxFWom4JyII+92+BkIkJAtA+VGl8MaAG2SuG5STzd3B/LYSSN+EvNxk8kSM+M2we/m6pp4PtpwPFlySHmfjjKPambko7EyJk088w3kQqdAYLjpBggrJ6qFUB19m+QPY42asnKclXuwSIbelTpSq3YBkTKQroPndUAf5Ia4v3k7Q8X+M0rD0aSoocakPNwqbaew0fKlqpWJB5Vrp/LZ/YmHSWQDu1hD2Lmm63qWaNCjTKdESZ2XbVOIT+IxAQ3qwiRWMHrU7eGvw678/zBEnT0O7v9YqOYbF5szTJqcmStuJBJJyTOM/FOmBQqgye5kJvnTQlgSEqqsBPl1ZwYium/4S5UXss=----ATTACHMENT:----NzQ3ODU0OTc3Nzc2NzMxMSAxMzM3Njk3Nzc4NzU4OTM1IDY2OTI4ODUzNTE4NjU5MDU=