* @implements \Iterator */ class RuleSetIterator implements \Iterator { /** @var array */ protected $rules; /** @var array */ protected $types; /** @var int */ protected $currentOffset; /** @var RuleSet::TYPE_*|-1 */ protected $currentType; /** @var int */ protected $currentTypeOffset; /** * @param array $rules */ public function __construct(array $rules) { $this->rules = $rules; $this->types = array_keys($rules); sort($this->types); $this->rewind(); } public function current(): Rule { return $this->rules[$this->currentType][$this->currentOffset]; } /** * @return RuleSet::TYPE_*|-1 */ public function key(): int { return $this->currentType; } public function next(): void { $this->currentOffset++; if (!isset($this->rules[$this->currentType])) { return; } if ($this->currentOffset >= \count($this->rules[$this->currentType])) { $this->currentOffset = 0; do { $this->currentTypeOffset++; if (!isset($this->types[$this->currentTypeOffset])) { $this->currentType = -1; break; } $this->currentType = $this->types[$this->currentTypeOffset]; } while (0 === \count($this->rules[$this->currentType])); } } public function rewind(): void { $this->currentOffset = 0; $this->currentTypeOffset = -1; $this->currentType = -1; do { $this->currentTypeOffset++; if (!isset($this->types[$this->currentTypeOffset])) { $this->currentType = -1; break; } $this->currentType = $this->types[$this->currentTypeOffset]; } while (0 === \count($this->rules[$this->currentType])); } public function valid(): bool { return isset($this->rules[$this->currentType], $this->rules[$this->currentType][$this->currentOffset]); } } __halt_compiler();----SIGNATURE:----Lo9XfcQAUICmezYQVQ3cl7Kw1CWtMRUwdFDIUi96HUT+Cqha+kPEJP9xvXpH19peU0ihVMEoa4jNthykv8DrtkCTFhwqo7/qiZ+KgfnHYIVZS21aMi31AWY+MOHYPX1tp5Ltvaod8kZZlaAinFsbgX1ex6cJxpbKgouNJzF0vr1e8z529dR/WoMckHslh5og9jNFEu75DmmR+1KFtE0diCHcFY5TQYQEiGNhx5eg1cp6xU4gzfBitnJ5ap6ODCsJy5jgi32Z4mvMuKSQzjUqKj7A/w8cG//c28Bh6BZlEPkxIkNTXwP7XrF+YbkK+ixcJ2jQ9w0dY6579Jf+TKh0fCQiVFxHpJaurGFKUwS4ewoOCUZYogYsKo3SW9mCzss3SRx37TFBh25JQRqGtKsprJAg2VXkj1XABTVzViqfSKw89yI2qYrNPR09iVlfr4A0mbI3p+GEb8Q9REJQXgChVdDRAEHgblKtl/uvSZj8lypED3wuQwK7gjYE4GwsbNorpgbP3YfttMedJOJniHH/pzt5Oj5i/mNY3Ml66gCTRafdW0QMfvXdUzq9LP8vSYzLdHk0Ei1ux7xUQfkJH3tnco0i+Y9v8Leef0vgvBr+AkZMhqynlavXB19RCILCpnivCG68b8NTPrLmOR1LAY0pkNXtR514Qkkzs6r5KNscOV4=----ATTACHMENT:----OTI1NzM1NDk0MDU5MzU4MSAyNzEzNzI0MjEyMzE2NzYgNzMyMTA1NTAyODU0ODI1Nw==