kind = $kind; $this->code = $code; $this->message = $message; $this->delay_ms = $delay_ms; } /** * Work remains in this stage. The runner calls it again while time remains. */ public static function more( int $delay_ms = 0 ): self { return new self( self::MORE, '', '', $delay_ms ); } /** * This stage is finished; move to the next one. */ public static function next(): self { return new self( self::NEXT ); } /** * Nothing to do server-side until the browser acts (import upload). */ public static function wait(): self { return new self( self::WAIT ); } public static function fail( string $code, string $message ): self { return new self( self::FAIL, $code, $message ); } public function kind(): string { return $this->kind; } public function code(): string { return $this->code; } public function message(): string { return $this->message; } public function delayMs(): int { return $this->delay_ms; } }