success = $success; $this->status = $status; $this->body = $body; $this->error = $error; } public static function success( int $status, string $body ): self { return new self( true, $status, $body, '' ); } public static function failure( int $status, string $error ): self { return new self( false, $status, '', $error ); } public function isSuccess(): bool { return $this->success; } public function status(): int { return $this->status; } public function body(): string { return $this->body; } public function error(): string { return $this->error; } }