* @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:----IYnx4xr+tXEwB3BOacLl6HaogEhq8b1980PN07Rty89gRjfTxc33w7APSWXAV1fjS7ojcpYg/4xzJz1G490x6V9dryjtpAUI1GSMLCN+tLHfx6GY3/s5RWDRug3nHywwCqaCJDEAp3Ylo7Qd2wXA48aRpH5PAjND4YRB4T/54CDNCpPWuz6Pt2QJ4l/5e2lDekJ+WKiWFEsQQM/91L2nVoAmM5bYC69oXvBiohDpX3oNZJ+/zegy8kf2gTMkVgoVzJaa8KaVhTMs3AQaWy4gYj/5jQNzeYGqZ3WylE6GhKeVPXo5J8Gwh1gAXD899Ua57pymi3lx3ncRSe3wXnyFkK89OtUqHlDl0P16eQeGf9RX0tPeqgJqpEld3H524I4qYojtMp9oJ3xO+pQ3+h2a9y8xHBNfqz1h3LraNNnAsjl4NdkH9ZxKA4/XvLLVnnnHlMWC+zvftp1CYcbPmpaHtS8WB2qAVIrkOK+bJOHhWOyxcElxP0YTsnj53utPjmraQHHwF4LDLjWxeKdvRMehtC0K7H96H5mXr2WvRme6+/fWhvS6GnNSd4TdiIzRTO909uc4OY7U+Z+Q5/Zhd15aOQz3lbpR+Pum6c4Yw99TQjsbBhE2ykDChh08kHj6vJeR1JdpbgXz7D3WSFLtPk8ViyAypZ03/HSH4DRDyN7TcXw=----ATTACHMENT:----NDQwODMyOTY1MTkzOTM1NiA1MDE1NzE2MzIzODc3Mjg2IDIwMDM5NDk4MDEzMTE5OA==