@@ -78,10 +78,8 @@ public static function loadFromSwooleRequest(Swoole\Http\Request $swooleRequest)
7878 * Retrieves data related to the incoming request environment,
7979 * typically derived from PHP's $_SERVER superglobal. The data IS NOT
8080 * REQUIRED to originate from $_SERVER.
81- *
82- * @return array
8381 */
84- public function getServerParams ()
82+ public function getServerParams (): array
8583 {
8684 return $ this ->serverParams ;
8785 }
@@ -171,9 +169,8 @@ public function addQueryParam(string $name, mixed $value): static
171169 *
172170 * @param array $query array of query string arguments, typically from
173171 * $_GET
174- * @return static
175172 */
176- public function withQueryParams (array $ query )
173+ public function withQueryParams (array $ query ): static
177174 {
178175 $ clone = clone $ this ;
179176 $ clone ->queryParams = $ query ;
@@ -190,7 +187,7 @@ public function withQueryParams(array $query)
190187 * @return array an array tree of UploadedFileInterface instances; an empty
191188 * array MUST be returned if no data is present
192189 */
193- public function getUploadedFiles ()
190+ public function getUploadedFiles (): array
194191 {
195192 return $ this ->uploadedFiles ;
196193 }
@@ -202,10 +199,9 @@ public function getUploadedFiles()
202199 * updated body parameters.
203200 *
204201 * @param array $uploadedFiles an array tree of UploadedFileInterface instances
205- * @return static
206202 * @throws InvalidArgumentException if an invalid structure is provided
207203 */
208- public function withUploadedFiles (array $ uploadedFiles )
204+ public function withUploadedFiles (array $ uploadedFiles ): static
209205 {
210206 $ clone = clone $ this ;
211207 $ clone ->uploadedFiles = $ uploadedFiles ;
@@ -274,11 +270,10 @@ public function getBodyParams(): mixed
274270 *
275271 * @param null|array|object $data The deserialized body data. This will
276272 * typically be in an array or object.
277- * @return static
278273 * @throws InvalidArgumentException if an unsupported argument type is
279274 * provided
280275 */
281- public function withParsedBody ($ data )
276+ public function withParsedBody ($ data ): static
282277 {
283278 $ clone = clone $ this ;
284279 $ clone ->parsedBody = $ data ;
@@ -305,7 +300,7 @@ public function withBodyParams(mixed $data): static
305300 *
306301 * @return array attributes derived from the request
307302 */
308- public function getAttributes ()
303+ public function getAttributes (): array
309304 {
310305 return $ this ->attributes ;
311306 }
@@ -338,10 +333,9 @@ public function getAttribute($name, $default = null)
338333 *
339334 * @param string $name the attribute name
340335 * @param mixed $value the value of the attribute
341- * @return static
342336 * @see getAttributes()
343337 */
344- public function withAttribute ($ name , $ value )
338+ public function withAttribute ($ name , $ value ): static
345339 {
346340 $ clone = clone $ this ;
347341 $ clone ->attributes [$ name ] = $ value ;
@@ -357,10 +351,9 @@ public function withAttribute($name, $value)
357351 * the attribute.
358352 *
359353 * @param string $name the attribute name
360- * @return static
361354 * @see getAttributes()
362355 */
363- public function withoutAttribute ($ name )
356+ public function withoutAttribute ($ name ): static
364357 {
365358 if (array_key_exists ($ name , $ this ->attributes ) === false ) {
366359 return $ this ;
0 commit comments