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 /WpfTest/HttpResponseStatus | |
| parent | 50edbd3907c26a2d4d616421de9bb51a4d083c1b (diff) | |
rename to Digitigrade / PawPub
:3
Diffstat (limited to 'WpfTest/HttpResponseStatus')
| -rw-r--r-- | WpfTest/HttpResponseStatus/BadRequest.php | 18 | ||||
| -rw-r--r-- | WpfTest/HttpResponseStatus/InternalServerError.php | 23 | ||||
| -rw-r--r-- | WpfTest/HttpResponseStatus/NoHandlerFound.php | 18 | ||||
| -rw-r--r-- | WpfTest/HttpResponseStatus/NotFound.php | 18 |
4 files changed, 0 insertions, 77 deletions
diff --git a/WpfTest/HttpResponseStatus/BadRequest.php b/WpfTest/HttpResponseStatus/BadRequest.php deleted file mode 100644 index 74fab3c..0000000 --- a/WpfTest/HttpResponseStatus/BadRequest.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -namespace WpfTest\HttpResponseStatus; - -use WpfTest\HttpResponseStatus; - -class BadRequest extends \Exception implements HttpResponseStatus { - public function __construct(?string $reason) { - $this->message = $reason ?? 'Request does not conform to expectations'; - } - - public function httpCode(): int { - return 400; - } - - public function httpReason(): string { - return "Bad Request"; - } -}
\ No newline at end of file diff --git a/WpfTest/HttpResponseStatus/InternalServerError.php b/WpfTest/HttpResponseStatus/InternalServerError.php deleted file mode 100644 index 11b67f3..0000000 --- a/WpfTest/HttpResponseStatus/InternalServerError.php +++ /dev/null @@ -1,23 +0,0 @@ -<?php -namespace WpfTest\HttpResponseStatus; - -use WpfTest\GlobalConfig; -use WpfTest\HttpResponseStatus; - -class InternalServerError extends \Exception implements HttpResponseStatus { - public function __construct(\Throwable $reason, ?string $context = null) { - $this->message = $reason::class . ': ' . $reason->getMessage(); - if (isset($context)) { - $this->message .= " [$context]"; - } - if (GlobalConfig::getInstance()->shouldReportTraces()) { - $this->message .= "\n" . $reason->getTraceAsString(); - } - } - public function httpCode(): int { - return 500; - } - public function httpReason(): string { - return "Internal Server Error"; - } -}
\ No newline at end of file diff --git a/WpfTest/HttpResponseStatus/NoHandlerFound.php b/WpfTest/HttpResponseStatus/NoHandlerFound.php deleted file mode 100644 index 9ceeb0b..0000000 --- a/WpfTest/HttpResponseStatus/NoHandlerFound.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -namespace WpfTest\HttpResponseStatus; - -use WpfTest\HttpResponseStatus; - -class NoHandlerFound extends \Exception implements HttpResponseStatus { - public function __construct(string $path) { - $this->message = "No handler found for path $path"; - } - - public function httpCode(): int { - return 404; - } - - public function httpReason(): string { - return "Not Found"; - } -}
\ No newline at end of file diff --git a/WpfTest/HttpResponseStatus/NotFound.php b/WpfTest/HttpResponseStatus/NotFound.php deleted file mode 100644 index b36d0a3..0000000 --- a/WpfTest/HttpResponseStatus/NotFound.php +++ /dev/null @@ -1,18 +0,0 @@ -<?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 |
