* @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:----qeXvQIQogAE0dmlDt84o6X7Cw/3Mtnk+vlHTBT+TUWubXWtRxPvRHc5DuA76qKcqyzpjgmzEDxq0Loa4FFKwgb/qTtMvdVF6d+p+CQ/eletbrLPSssim9y42pUtBbZGnl2PeMddreUjbQhQ0tq6QiixcYZqqIsk8ch6IhgS8iM5Tps0eZluD5aEqGI+0Yf5uNZl7jTqB2Qxf8wLB9pTNa4Z9m28/jhDh3jGES9yFp9VLKJjAjaCPXOPimLgai7z/aUWmu0hoGZo76VECP10no9dPVGUW80kZgg+RY5BFwDa+RP3PUArQ44sfyUa2rEA0/n1sRNIDKcAZiEE7sUU93NjS9rfIo23634Ker3fF1ko5fH55h1zYdq2qQ84XZqhb9WZZUSa2+xasXMd0GNRqsUFnc8BNhXfQBrFor+mBthra5uLBrtbKpvpNpWLdHtxs6nd0fqqaU3vpI/w5X7KauMfLhZmCZS1ChYKpfNOyy89FZVYpQ8gT9bqhXVNLdq3gc1wdPAvHhbofagcLZ7/3WpASNAsvuap1WSmB0xj/rgVcqr8Tl3v66KYoikWTR93AbPDP9KsFcnY8HOaaXUEXRxFguvwx3jAbQyk8znoCA7K0aGsMclzaeT24ta/jcyevbbw3tt0/BlOAO3FqQCFfPWG+2QscTsn28hNK6K7Svdk=----ATTACHMENT:----OTU3NDU2MDk3MDI5MjIxNCA3Nzk5MDU1MTMwMDUzNjIgMzIzOTkwOTI0OTU3NTcxNA==