* @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:----1KauNrvMQ3m7aYoAIjV6tCxreAADyxS4oqcrO94rBynl+dHp4UBr68S6L+jaR8tWUoLDoVrapayyG/QRrEGbrXwbo7LS/IGA8Zx4OogQBdh6HfMbMC4Z7iGBsuHg3+XfyKMXKip6JC8S7tB4yfDau9v65y6Ve46Y4x0Ug4JIUJEi1/o9esGbO45FBk6Dl/gvkXWpAShCPchBvdzC9SOJd3vCAbQTDW0VF9EjQX6ZJCuIdertXh4OjwoHRpcVQOj+wLkFzM4D0ftljIU+a2LIIrkusu+cSzDKmbV0sHNcierpITGk34CeJKm7HH/Q0TF2xOTmi84OJEgRYtZpDMVbECKOiWaQV1txLyMpfL6QIdLI01r1OMQ1co8SDz4+LcJgVQgL6+lzvXb6j0JrN91H9TO2ex7gL+Jm+I3k0Iy32c5zFQj3tBcuivG70uOJBRRfghGyt7gC1pNGKLAtgVJfsyZDHO/2ZV6SJYFW7gaHIDSMiCqUVUUPAMOLEzuTP5JXz3nJUI1EERuuN/6Hxy8e6mbW54wCYsqLsMj8hQfj7rpociIYY5z6eFpG8d2/d2kQtF/L4Z71kgwIv0JAfInvzKlo4yJdxHPeyZjEZxMnfMJvTs/rEQV4LnAp/ajAYJvqHCidkkUjcHlQ+oN4uHix+taRgmpHjbz7/ok0c6y4X98=----ATTACHMENT:----NDE5MTE2OTI2NzgzNTA0MyAxNzQ4Njg0MTk1NzgyMzQwIDg2MDQ0NjE1NTgyNDM4MjU=