Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
20 | public function fromGlobals(): ServerRequest |
||
21 | { |
||
22 | $method = $_SERVER['REQUEST_METHOD'] ?? 'GET'; |
||
23 | $uri = $_SERVER['REQUEST_URI'] ?? ''; |
||
24 | $protocolVersion = (new Protocol())->getVersion($_SERVER); |
||
25 | $headers = (new HeadersCollection($_SERVER))->get(); |
||
26 | $body = 'php://input'; |
||
27 | |||
28 | return new ServerRequest( |
||
29 | $method, |
||
30 | $uri, |
||
31 | $protocolVersion, |
||
32 | $headers, |
||
33 | $_GET, |
||
34 | $body, |
||
35 | $_SERVER, |
||
36 | $_COOKIE, |
||
37 | $_FILES, [] |
||
38 | ); |
||
39 | } |
||
40 | } |