* @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:----hO0SwnVKlvnvYRm5edU6DnLwePIqvJlqAIks/dbURuYM76mOF1c6R2GfOpG8Om0XinR91PcqXCquIzsg2beee6gIWq1KwSNWmvUs0IPYmkF8ChMBepuYuPt1eaoVpjQMsB3RwQmES9tPX/jYlp0ncd7MKEMIxXGccDkXNK0DLHynoj1d04N1oGyDCfTRmVjJ+z3fepuYrFaie7R1Qv/c9r2DjnK1RjU3S0sYraLjilmeYMcwbH3e07sQ01eOnvFWr+MuFFjUHhrHmlez2pn8X6UFDYkdQHDlHpZGWtpwdEW10nkHWvwWeUTs5jzC6D5l3qgA6sA4jkAy2hyJky1DsubRe9C9JwFSDF1ZuE+XLC7m1CXTKHm0EmE7XQxa26vRC6Q4gcp59GojnIQlFIvrrO5SNE+e+qcv43sWAq0KK3b8tIQOR/96Obvccgaa9XF6/BBzL6KfHIMNNbefHHltr2JA/7x66GSS5uWI/RdhqTn8GDEzsG9zMq+PH5hLW7+8TNZl1O5s9Q7/oX5kfh2rk/N0qx6Xh27MUnboUlugXshkdmovJgUXLaNkJioh1q2EKYKZ8dsTFsxKbUrS7LSWae5+s17Dsm8xZlU4pqm9QlKXKtuaRiRm9I+4xbEYfPkLG9qAYHKxueH7aKqKJ34ep5bRs03t9t5Dp1mVdk0dWeE=----ATTACHMENT:----Njc5Mzk3NTk0MTQxMTc5NiAzMDkwNzUzMDcyNjc3Mzg2IDI5OTA3MDY0Mjk3MzkzOTk=