From e1ad307b531c27ec6bfaf8b4d018991b0d4a78f3 Mon Sep 17 00:00:00 2001 From: winter Date: Fri, 6 Dec 2024 20:43:26 +0000 Subject: initial commit hardcoded functionality mostly! --- WpfTest/HttpReturnStatus/BadRequest.php | 18 ++++++++++++++++++ WpfTest/HttpReturnStatus/InternalServerError.php | 16 ++++++++++++++++ WpfTest/HttpReturnStatus/NoHandlerFound.php | 18 ++++++++++++++++++ WpfTest/HttpReturnStatus/NotFound.php | 18 ++++++++++++++++++ 4 files changed, 70 insertions(+) create mode 100644 WpfTest/HttpReturnStatus/BadRequest.php create mode 100644 WpfTest/HttpReturnStatus/InternalServerError.php create mode 100644 WpfTest/HttpReturnStatus/NoHandlerFound.php create mode 100644 WpfTest/HttpReturnStatus/NotFound.php (limited to 'WpfTest/HttpReturnStatus') diff --git a/WpfTest/HttpReturnStatus/BadRequest.php b/WpfTest/HttpReturnStatus/BadRequest.php new file mode 100644 index 0000000..83b5011 --- /dev/null +++ b/WpfTest/HttpReturnStatus/BadRequest.php @@ -0,0 +1,18 @@ +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/HttpReturnStatus/InternalServerError.php b/WpfTest/HttpReturnStatus/InternalServerError.php new file mode 100644 index 0000000..0141e26 --- /dev/null +++ b/WpfTest/HttpReturnStatus/InternalServerError.php @@ -0,0 +1,16 @@ +message = $reason->getMessage(); + } + public function httpCode(): int { + return 500; + } + public function httpReason(): string { + return "Internal Server Error"; + } +} \ No newline at end of file diff --git a/WpfTest/HttpReturnStatus/NoHandlerFound.php b/WpfTest/HttpReturnStatus/NoHandlerFound.php new file mode 100644 index 0000000..d914ca2 --- /dev/null +++ b/WpfTest/HttpReturnStatus/NoHandlerFound.php @@ -0,0 +1,18 @@ +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/HttpReturnStatus/NotFound.php b/WpfTest/HttpReturnStatus/NotFound.php new file mode 100644 index 0000000..eef23b3 --- /dev/null +++ b/WpfTest/HttpReturnStatus/NotFound.php @@ -0,0 +1,18 @@ +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 -- cgit v1.3