public function valid() { if ($this->streamed_count->equals($this->limit) && !$this->is_unlimited()) { return false; } return $this->event_snapshots->valid(); }
public function run() { while ($this->can_upgrade()) { $function = $this->get_function_name(); if (!method_exists($this, $function)) { throw new \Exception('An upgrade handler could not be found.'); } $this->{$function}($this->schema); $this->version = $this->version->increment(); } }