4040class Request
4141{
4242 /**
43- * @var string URL being requested
43+ * URL being requested
4444 */
4545 public string $ url ;
4646
4747 /**
48- * @var string Parent subdirectory of the URL
48+ * Parent subdirectory of the URL
4949 */
5050 public string $ base ;
5151
5252 /**
53- * @var string Request method (GET, POST, PUT, DELETE)
53+ * Request method (GET, POST, PUT, DELETE)
5454 */
5555 public string $ method ;
5656
5757 /**
58- * @var string Referrer URL
58+ * Referrer URL
5959 */
6060 public string $ referrer ;
6161
6262 /**
63- * @var string IP address of the client
63+ * IP address of the client
6464 */
6565 public string $ ip ;
6666
6767 /**
68- * @var bool Whether the request is an AJAX request
68+ * Whether the request is an AJAX request
6969 */
7070 public bool $ ajax ;
7171
7272 /**
73- * @var string Server protocol (http, https)
73+ * Server protocol (http, https)
7474 */
7575 public string $ scheme ;
7676
7777 /**
78- * @var string Browser information
78+ * Browser information
7979 */
8080 public string $ user_agent ;
8181
8282 /**
83- * @var string Content type
83+ * Content type
8484 */
8585 public string $ type ;
8686
8787 /**
88- * @var int Content length
88+ * Content length
8989 */
9090 public int $ length ;
9191
9292 /**
93- * @var Collection Query string parameters
93+ * Query string parameters
9494 */
9595 public Collection $ query ;
9696
9797 /**
98- * @var Collection Post parameters
98+ * Post parameters
9999 */
100100 public Collection $ data ;
101101
102102 /**
103- * @var Collection Cookie parameters
103+ * Cookie parameters
104104 */
105105 public Collection $ cookies ;
106106
107107 /**
108- * @var Collection Uploaded files
108+ * Uploaded files
109109 */
110110 public Collection $ files ;
111111
112112 /**
113- * @var bool Whether the connection is secure
113+ * Whether the connection is secure
114114 */
115115 public bool $ secure ;
116116
117117 /**
118- * @var string HTTP accept parameters
118+ * HTTP accept parameters
119119 */
120120 public string $ accept ;
121121
122122 /**
123- * @var string Proxy IP address of the client
123+ * Proxy IP address of the client
124124 */
125125 public string $ proxy_ip ;
126126
127127 /**
128- * @var string HTTP host name
128+ * HTTP host name
129129 */
130130 public string $ host ;
131131
132132 /**
133133 * Stream path for where to pull the request body from
134- *
135- * @var string
136134 */
137135 private string $ stream_path = 'php://input ' ;
138136
139137 /**
140- * @var string Raw HTTP request body
138+ * Raw HTTP request body
141139 */
142140 public string $ body = '' ;
143141
@@ -146,7 +144,7 @@ class Request
146144 *
147145 * @param array<string, mixed> $config Request configuration
148146 */
149- public function __construct ($ config = [])
147+ public function __construct (array $ config = [])
150148 {
151149 // Default properties
152150 if (empty ($ config )) {
@@ -179,9 +177,9 @@ public function __construct($config = [])
179177 * Initialize request properties.
180178 *
181179 * @param array<string, mixed> $properties Array of request properties
182- * @return self
180+ * @return $this
183181 */
184- public function init (array $ properties = [])
182+ public function init (array $ properties = []): self
185183 {
186184 // Set all the defined properties
187185 foreach ($ properties as $ name => $ value ) {
@@ -322,6 +320,7 @@ public static function parseQuery(string $url): array
322320 return $ params ;
323321 }
324322
323+ /** @return 'http'|'https' */
325324 public static function getScheme (): string
326325 {
327326 if (
0 commit comments