diff options
Diffstat (limited to 'WpfTest/HttpResponseStatus/NotFound.php')
| -rw-r--r-- | WpfTest/HttpResponseStatus/NotFound.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/WpfTest/HttpResponseStatus/NotFound.php b/WpfTest/HttpResponseStatus/NotFound.php new file mode 100644 index 0000000..b36d0a3 --- /dev/null +++ b/WpfTest/HttpResponseStatus/NotFound.php @@ -0,0 +1,18 @@ +<?php +namespace WpfTest\HttpResponseStatus; + +use WpfTest\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 |
