diff options
| author | winter | 2024-12-09 21:31:54 +0000 |
|---|---|---|
| committer | winter | 2024-12-09 21:31:54 +0000 |
| commit | 4c7bde1400820f36caf8b2a5374007384c3018f3 (patch) | |
| tree | 83ed26ff368117b8e392f7bc28736482077fc2f4 /Digitigrade/HttpResponseStatus/NotFound.php | |
| parent | 50edbd3907c26a2d4d616421de9bb51a4d083c1b (diff) | |
rename to Digitigrade / PawPub
:3
Diffstat (limited to 'Digitigrade/HttpResponseStatus/NotFound.php')
| -rw-r--r-- | Digitigrade/HttpResponseStatus/NotFound.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Digitigrade/HttpResponseStatus/NotFound.php b/Digitigrade/HttpResponseStatus/NotFound.php new file mode 100644 index 0000000..643976c --- /dev/null +++ b/Digitigrade/HttpResponseStatus/NotFound.php @@ -0,0 +1,18 @@ +<?php +namespace Digitigrade\HttpResponseStatus; + +use Digitigrade\HttpResponseStatus; + +class NotFound extends \Exception implements HttpResponseStatus { + public function __construct(?string $reason) { + $this->message = $reason ?? 'Request was handled but no appropriate resource found'; + } + + public function httpCode(): int { + return 404; + } + + public function httpReason(): string { + return "Not Found"; + } +}
\ No newline at end of file |
