blob: fbf0def93cece1200baa6b3c81f83b107633c846 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
<?php
namespace Digitigrade\HttpResponseStatus;
use Digitigrade\HttpResponseStatus;
class TemporaryRedirect extends \Exception implements HttpResponseStatus {
public string $target;
public function __construct(string $target) {
$this->target = $target;
$this->message = "Redirecting to $target";
}
public function httpCode(): int {
return 302;
}
public function httpReason(): string {
return "Found";
}
public function httpHeaders() {
header("Location: $this->target");
}
}
|