* @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:----Fe/XAymZJQo2yYG9wXXwTQNBncbSLXF46dIqM8DeMriSNK8dj172spk1xCdA9Sao+QESmNMV+pv8OjzAQVBIJ+hvD0xCVQvv6i3Du8oGdnei4rKwiswimPi1Zv3/98k3GxoEl1EoJ9KY/F3NV1152OOQHo7Kv5mMkuv1GO7SaG6XsXQBrLhqwII/HIpcct2TcMfCnjK+aNwfZWgbtREXeS90poW6AKFZtq6hpS0VrdcS2tt9bX88Uh6yKhLLprsM5FgB19jQRuEo7HzFc+SVaX34BrnQo/dfqPk8xjhLbAhqPHqbqTuIoUK4UmWPSL9tzdjZB+q+BlcNE8MIxjUohc82sq6Iv/AWMCBbRTE+owfAVHdAipBaExeRHTHjzcyzQIIgDt+3WxsFauJ/ICpb8053zp8Htz08qwMesCsPs01gzCFGz95tbnqjc8T/7dNGoa37/esS99XSpsIiM0jmBOLiTo5jntboyHOgmJcci3W8DkApyX8rAeMXVU9eOfMzRaMOJIykuyDs/iCjsk2Grv7OwyElf20VqUAJXufCrhH6j46/WU2lmtABKMwW3UF5CVBONKa3DF4trNcqel11rBIBDIj1feF4wGENEOq5+ZXj+MmsEa6DdnwRVLfz7E0QS6p0ZZBgjU3boRTfZcdcmKyKo3xsPtjq4+hjfxqrdJI=----ATTACHMENT:----MTkxOTkyNDUxMzgzMTc0NyAyMTU1NjMwODQxMTUyNjY3IDQ2MzkxNTI5MDYzMzU3NTY=