Skip to content

Commit

Permalink
Update JsonResponse.php
Browse files Browse the repository at this point in the history
  • Loading branch information
secure73 authored Nov 19, 2023
1 parent 90427a4 commit a92b498
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/http/JsonResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ public function notAcceptable(string $service_message = null):bool{
return $this->create(406, null, null, $service_message);
}

public function conflict(string $service_message = null):bool{
return $this->create(409, null, null, $service_message);
}

public function unsupportedMediaType(string $service_message = null):bool{
return $this->create(415, null, null, $service_message);
}
Expand Down Expand Up @@ -140,7 +144,10 @@ private function setHttpMessage(int $httpCode):string
case 403: return 'forbidden';
case 404: return 'not found';
case 406: return 'not acceptable';
case 409: return 'conflict';
case 415: return 'unsupported media type';
case 415: return 'unsupported media type';
case 422: return 'unprocessable entity';
case 500: return 'internal error';
default: return 'unknown error';
}
Expand Down

0 comments on commit a92b498

Please sign in to comment.