1 | <?php |
||
16 | class Request |
||
17 | { |
||
18 | /** |
||
19 | * @var Param |
||
20 | */ |
||
21 | public static $postData; |
||
22 | |||
23 | /** |
||
24 | * @var Param |
||
25 | */ |
||
26 | public static $getData; |
||
27 | |||
28 | /** |
||
29 | * @var Param |
||
30 | */ |
||
31 | public static $cookieData; |
||
32 | |||
33 | /** |
||
34 | * @var Param |
||
35 | */ |
||
36 | public static $cliData; |
||
37 | |||
38 | /** |
||
39 | * @var Util\Uploaded |
||
40 | */ |
||
41 | public static $filesData; |
||
42 | |||
43 | /** |
||
44 | * @var Environment |
||
45 | */ |
||
46 | public $env; |
||
47 | |||
48 | /** |
||
49 | * The request HTTP method send by the client-browser. |
||
50 | * |
||
51 | * @var null|string |
||
52 | */ |
||
53 | protected $method = null; |
||
54 | |||
55 | /** |
||
56 | * @param array $getData |
||
57 | * @param array $postData |
||
58 | * @param array $cookieData |
||
59 | * @param array $cliData |
||
60 | * @param array $filesData |
||
61 | * @param \Pimf\Environment $env |
||
62 | */ |
||
63 | public function __construct( |
||
81 | |||
82 | /** |
||
83 | * For fetching body/params sent via PUT|DELETE|PATCH Http method. |
||
84 | * |
||
85 | * @param bool $asResource |
||
86 | * |
||
87 | * @return Param|resource|boolean |
||
88 | */ |
||
89 | public function streamInput($asResource = false) |
||
107 | |||
108 | /** |
||
109 | * HTTP GET variables. |
||
110 | * |
||
111 | * @return Param |
||
112 | */ |
||
113 | public function fromGet() |
||
117 | |||
118 | /** |
||
119 | * CLI arguments passed to script. |
||
120 | * |
||
121 | * @return Param |
||
122 | */ |
||
123 | public function fromCli() |
||
127 | |||
128 | /** |
||
129 | * HTTP POST variables. |
||
130 | * |
||
131 | * @return Param |
||
132 | */ |
||
133 | public function fromPost() |
||
137 | |||
138 | /** |
||
139 | * HTTP Cookies. |
||
140 | * |
||
141 | * @return Param |
||
142 | */ |
||
143 | public function fromCookie() |
||
147 | |||
148 | /** |
||
149 | * Strip slashes from string or array |
||
150 | * |
||
151 | * @param $rawData |
||
152 | * |
||
153 | * @return array|string |
||
154 | */ |
||
155 | public static function stripSlashes($rawData) |
||
166 | |||
167 | /** |
||
168 | * @param bool $asResource |
||
169 | * |
||
170 | * @return resource|string |
||
171 | * @throws \LogicException When using the resource twice times. |
||
172 | */ |
||
173 | public function getContent($asResource = false) |
||
193 | |||
194 | /** |
||
195 | * The request method send by the client-browser. |
||
196 | * |
||
197 | * @return null|string |
||
198 | */ |
||
199 | public function getMethod() |
||
203 | } |
||
204 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.