diff options
| author | winter | 2024-12-16 20:27:01 +0000 |
|---|---|---|
| committer | winter | 2024-12-16 20:41:33 +0000 |
| commit | 68c7e68b3f90fd980661774fdb2bb2d6140a34d0 (patch) | |
| tree | 7993de39c7c637369bdbfb22e265319b43fcbf33 /Digitigrade/HttpResponseStatus/Forbidden.php | |
| parent | 2f4c1de3509141880df019ef1a6cc65981b3f6ea (diff) | |
implement the other side of auth (hopefully?)
also mostly untested for the same reason as last time
Diffstat (limited to 'Digitigrade/HttpResponseStatus/Forbidden.php')
| -rw-r--r-- | Digitigrade/HttpResponseStatus/Forbidden.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Digitigrade/HttpResponseStatus/Forbidden.php b/Digitigrade/HttpResponseStatus/Forbidden.php new file mode 100644 index 0000000..4c3588f --- /dev/null +++ b/Digitigrade/HttpResponseStatus/Forbidden.php @@ -0,0 +1,21 @@ +<?php +namespace Digitigrade\HttpResponseStatus; + +use Digitigrade\HttpResponseStatus; + +class Forbidden extends \Exception implements HttpResponseStatus { + public function __construct(?string $reason) { + $this->message = $reason ?? 'The provided authorization is invalid for this request'; + } + + public function httpCode(): int { + return 403; + } + + public function httpReason(): string { + return "Forbidden"; + } + + public function httpHeaders() { + } +}
\ No newline at end of file |
