PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 3.1.0
Defender Security – Malware Scanner, Login Security & Firewall v3.1.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
defender-security / vendor / nyholm / psr7-server / src / ServerRequestCreatorInterface.php

ServerRequestCreatorInterface.php in Defender Security – Malware Scanner, Login Security & Firewall 3.1.0, at vendor/nyholm/psr7-server/src/ServerRequestCreatorInterface.php

57 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Nyholm\Psr7Server;
6
7 use Psr\Http\Message\ServerRequestInterface;
8 use Psr\Http\Message\StreamInterface;
9
10 /**
11 * @author Tobias Nyholm <[email protected]>
12 * @author Martijn van der Ven <[email protected]>
13 */
14 interface ServerRequestCreatorInterface
15 {
16 /**
17 * Create a new server request from the current environment variables.
18 * Defaults to a GET request to minimise the risk of an \InvalidArgumentException.
19 * Includes the current request headers as supplied by the server through `getallheaders()`.
20 * If `getallheaders()` is unavailable on the current server it will fallback to its own `getHeadersFromServer()` method.
21 * Defaults to php://input for the request body.
22 *
23 * @throws \InvalidArgumentException if no valid method or URI can be determined
24 */
25 public function fromGlobals(): ServerRequestInterface;
26
27 /**
28 * Create a new server request from a set of arrays.
29 *
30 * @param array $server typically $_SERVER or similar structure
31 * @param array $headers typically the output of getallheaders() or similar structure
32 * @param array $cookie typically $_COOKIE or similar structure
33 * @param array $get typically $_GET or similar structure
34 * @param array|null $post typically $_POST or similar structure, represents parsed request body
35 * @param array $files typically $_FILES or similar structure
36 * @param StreamInterface|resource|string|null $body Typically stdIn
37 *
38 * @throws \InvalidArgumentException if no valid method or URI can be determined
39 */
40 public function fromArrays(
41 array $server,
42 array $headers = [],
43 array $cookie = [],
44 array $get = [],
45 ?array $post = null,
46 array $files = [],
47 $body = null
48 ): ServerRequestInterface;
49
50 /**
51 * Get parsed headers from ($_SERVER) array.
52 *
53 * @param array $server typically $_SERVER or similar structure
54 */
55 public static function getHeadersFromServer(array $server): array;
56 }
57