default_frequency(), null, null ); } public function with_schedule( bool $enabled, Frequency $frequency ): self { return new self( $enabled, $frequency, $this->last_run_at, $this->last_count ); } public function with_run( int $ran_at, int $count ): self { return new self( $this->enabled, $this->frequency, $ran_at, $count ); } public function has_same_schedule( self $other ): bool { return $this->enabled === $other->enabled && $this->frequency === $other->frequency; } /** @return array */ public function to_array(): array { return array( 'enabled' => $this->enabled, 'frequency' => $this->frequency->value, 'last_run_at' => $this->last_run_at, 'last_count' => $this->last_count, ); } }