commit | author | age | ||
15e03a | 1 | <?php |
F | 2 | |
3 | declare(strict_types= 1); | |
4 | ||
5 | namespace Framework; | |
6 | ||
7 | class Request { | |
8 | public function __construct(public string $uri, | |
9 | public string $method, | |
10 | public array $get, | |
11 | public array $post, | |
12 | public array $files, | |
13 | public array $cookie, | |
14 | public array $server) { | |
15 | ||
16 | } | |
17 | ||
18 | public static function createFromGlobals() { | |
19 | return new static( | |
20 | $_SERVER["REQUEST_URI"], | |
21 | $_SERVER["REQUEST_METHOD"], | |
22 | $_GET, | |
23 | $_POST, | |
24 | $_FILES, | |
25 | $_COOKIE, | |
26 | $_SERVER | |
27 | ); | |
28 | } | |
29 | } | |
30 |