* @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:----nxMVZLme8VvxBNNxPE089XS1rsrWlYg+Qml+/Q0GIUgMlXWQZlG1jg49Jxtf7Yyk+0xPtl/41dWk8b9QXorrTC3oLaGNDa1NiRTSCAp7Nucx9aZFMp5V2ziHFFEjGO2KCB+Yt+V+F0JWRVg0OVS1Wqg2KZqXU3PSL+3DuHhI9uiRIMqlfSqC1d1fOzA0BTlwRqaeBsnh5B398kxICqba7fx8k8pQdWWly7EAFRkxdAyRipIFwUqzGnE6G+x+FI8PcPp3RWIj+0amfoFMVCRfUbHdpa+gVeWYhYLxkMbug0VZs/DNRqdOB1LI5Z2zbwcqRnrYmKFTN6YrqeI0u4qZEm84bR/rf6ftQqoa9l6GrTw1aHFtzwGSlN1WZH896JwJGa4+JgdRzHb95+7u5jI0TtmOzpfhF01/Qs6bkaBMDSNiveIuvfS92AZ050N9RO0PhlwHFtASHE67qIjT+NZCU9izWW0qDxZRivuodjjPwDcaqMOzZ4hxa+wv7ezdu9KCAhFxAqscZs2CgJbmTQTj5P1c4tT3s46QO6ouBSymZ2lGc+x4uwOW4Vs3C8cfFlR96642SH1teMEMZO+emZ9HeHzfgfQnmiGXgx/7cFaCWA1XrSp75bXxwJiclxXC8SvbBIVD+9wHk4QcI1nuzpKufa935ZRQ2qBR/+szLK3rr+k=----ATTACHMENT:----NTMxNTc2MzEyMTgzMjI3OCA4ODE2ODM3MzQwOTM2MjI0IDcwODUwMTE3OTg1MjI2MzM=