@@ -83,7 +83,7 @@ are also all found in the routing parameters:
8383
8484### Query String Parameters
8585
86- ` method ` Cake\\ Http\\ ServerRequest::** getQuery** ($name, $default = null)
86+ ` method ` Cake\\ Http\\ ServerRequest::** getQuery** ($name, $default = null): mixed
8787
8888Query string parameters can be read using the ` getQuery() ` method:
8989
@@ -143,7 +143,7 @@ Casting functions were added.
143143
144144### Request Body Data
145145
146- ` method ` Cake\\ Http\\ ServerRequest::** getData** ($name, $default = null)
146+ ` method ` Cake\\ Http\\ ServerRequest::** getData** ($name, $default = null): mixed
147147
148148All POST data normally available through PHP's ` $_POST ` global variable can be
149149accessed using ` Cake\Http\ServerRequest::getData() ` . For example:
@@ -231,7 +231,7 @@ Unlike `Cake\Http\ServerRequest::getData()`, `Cake\Http\ServerRequest::getUpload
231231only return data when an actual file upload exists for the given path, if there is regular, non-file request body data
232232present at the given path, then this method will return ` null ` , just like it would for any non-existent path.
233233
234- ` method ` Cake\\ Http\\ ServerRequest::** getUploadedFiles** ()
234+ ` method ` Cake\\ Http\\ ServerRequest::** getUploadedFiles** (): array
235235
236236Returns all uploaded files in a normalized array structure. For the above example with the file input name of
237237` attachment ` , the structure would look like:
@@ -244,7 +244,7 @@ Returns all uploaded files in a normalized array structure. For the above exampl
244244]
245245```
246246
247- ` method ` Cake\\ Http\\ ServerRequest::** withUploadedFiles** (array $files)
247+ ` method ` Cake\\ Http\\ ServerRequest::** withUploadedFiles** (array $files): static
248248
249249This method sets the uploaded files of the request object, it accepts an array of objects that implement
250250[ \Psr\Http\Message\UploadedFileInterface] ( https://www.php-fig.org/psr/psr-7/#16-uploaded-files ) . It will
@@ -304,7 +304,7 @@ types making the parsed data available in `$request->getData()` and
304304
305305### Environment Variables (from \$\_ SERVER and \$\_ ENV)
306306
307- ` method ` Cake\\ Http\\ ServerRequest::** getEnv** ($key, $default = null)
307+ ` method ` Cake\\ Http\\ ServerRequest::** getEnv** ($key, $default = null): string|null
308308
309309` ServerRequest::getEnv() ` is a wrapper for ` getenv() ` global function and acts as
310310a getter for environment variables without possible undefined keys:
@@ -319,7 +319,7 @@ To access all the environment variables in a request use `getServerParams()`:
319319$env = $this->request->getServerParams();
320320```
321321
322- ` method ` Cake\\ Http\\ ServerRequest::** withEnv** ($key, $value)
322+ ` method ` Cake\\ Http\\ ServerRequest::** withEnv** ($key, $value): static
323323
324324` ServerRequest::withEnv() ` is a wrapper for ` putenv() ` global function and acts as
325325a setter for environment variables without having to modify globals
@@ -376,7 +376,7 @@ $base = $request->getAttribute('webroot');
376376
377377### Checking Request Conditions
378378
379- ` method ` Cake\\ Http\\ ServerRequest::** is** ($type, $args...)
379+ ` method ` Cake\\ Http\\ ServerRequest::** is** ($type, $args...): bool
380380
381381The request object provides a way to inspect certain conditions in a given
382382request. By using the ` is() ` method you can check a number of common
@@ -403,7 +403,7 @@ detectors. There are different types of detectors that you can create:
403403 to handle the check. The callback will receive the request object as its only
404404 parameter.
405405
406- ` method ` Cake\\ Http\\ ServerRequest::** addDetector** ($name, $options)
406+ ` method ` Cake\\ Http\\ ServerRequest::** addDetector** ($name, $options): void
407407
408408Some examples would be:
409409
@@ -500,7 +500,7 @@ to use the session object.
500500
501501### Host and Domain Name
502502
503- ` method ` Cake\\ Http\\ ServerRequest::** domain** ($tldLength = 1)
503+ ` method ` Cake\\ Http\\ ServerRequest::** domain** ($tldLength = 1): string
504504
505505Returns the domain name your application is running on:
506506
@@ -509,7 +509,7 @@ Returns the domain name your application is running on:
509509echo $request->domain();
510510```
511511
512- ` method ` Cake\\ Http\\ ServerRequest::** subdomains** ($tldLength = 1)
512+ ` method ` Cake\\ Http\\ ServerRequest::** subdomains** ($tldLength = 1): array
513513
514514Returns the subdomains your application is running on as an array:
515515
@@ -518,7 +518,7 @@ Returns the subdomains your application is running on as an array:
518518$subdomains = $request->subdomains();
519519```
520520
521- ` method ` Cake\\ Http\\ ServerRequest::** host** ()
521+ ` method ` Cake\\ Http\\ ServerRequest::** host** (): string|null
522522
523523Returns the host your application is on:
524524
@@ -529,7 +529,7 @@ echo $request->host();
529529
530530### Reading the HTTP Method
531531
532- ` method ` Cake\\ Http\\ ServerRequest::** getMethod** ()
532+ ` method ` Cake\\ Http\\ ServerRequest::** getMethod** (): string
533533
534534Returns the HTTP method the request was made with:
535535
@@ -540,7 +540,7 @@ echo $request->getMethod();
540540
541541### Restricting Which HTTP method an Action Accepts
542542
543- ` method ` Cake\\ Http\\ ServerRequest::** allowMethod** ($methods)
543+ ` method ` Cake\\ Http\\ ServerRequest::** allowMethod** ($methods): bool
544544
545545Set allowed HTTP methods. If not matched, will throw
546546` MethodNotAllowedException ` . The 405 response will include the required
@@ -574,11 +574,11 @@ $hasAcceptHeader = $this->request->hasHeader('Accept');
574574While some apache installs don't make the ` Authorization ` header accessible,
575575CakePHP will make it available through apache specific methods as required.
576576
577- ` method ` Cake\\ Http\\ ServerRequest::** referer** ($local = true)
577+ ` method ` Cake\\ Http\\ ServerRequest::** referer** ($local = true): string|null
578578
579579Returns the referring address for the request.
580580
581- ` method ` Cake\\ Http\\ ServerRequest::** clientIp** ()
581+ ` method ` Cake\\ Http\\ ServerRequest::** clientIp** (): string
582582
583583Returns the current visitor's IP address.
584584
@@ -616,7 +616,7 @@ proxy.
616616
617617### Checking Accept Headers
618618
619- ` method ` Cake\\ Http\\ ServerRequest::** accepts** ($type = null)
619+ ` method ` Cake\\ Http\\ ServerRequest::** accepts** ($type = null): array|bool
620620
621621Find out which content types the client accepts, or check whether it accepts a
622622particular type of content.
@@ -633,7 +633,7 @@ Check for a single type:
633633$acceptsJson = $this->request->accepts('application/json');
634634```
635635
636- ` method ` Cake\\ Http\\ ServerRequest::** acceptLanguage** ($language = null)
636+ ` method ` Cake\\ Http\\ ServerRequest::** acceptLanguage** ($language = null): array|bool
637637
638638Get all the languages accepted by the client,
639639or check whether a specific language is accepted.
@@ -731,7 +731,7 @@ tasks such as:
731731
732732### Dealing with Content Types
733733
734- ` method ` Cake\\ Http\\ Response::** withType** ($contentType = null)
734+ ` method ` Cake\\ Http\\ Response::** withType** ($contentType = null): static
735735
736736You can control the Content-Type of your application's responses with
737737` Cake\Http\Response::withType() ` . If your application needs to deal
@@ -754,7 +754,7 @@ automatic view switching provided by [Controller Viewclasses](../controllers#con
754754
755755### Sending Files
756756
757- ` method ` Cake\\ Http\\ Response::** withFile** (string $path, array $options = [ ] )
757+ ` method ` Cake\\ Http\\ Response::** withFile** (string $path, array $options = [ ] ): static
758758
759759There are times when you want to send files as responses for your requests.
760760You can accomplish that by using ` Cake\Http\Response::withFile() ` :
@@ -850,7 +850,7 @@ redirect location header.
850850
851851### Setting the Body
852852
853- ` method ` Cake\\ Http\\ Response::** withStringBody** ($string)
853+ ` method ` Cake\\ Http\\ Response::** withStringBody** ($string): static
854854
855855To set a string as the response body, do the following:
856856
@@ -905,7 +905,7 @@ $response = $response->withBody($stream);
905905
906906### Setting the Character Set
907907
908- ` method ` Cake\\ Http\\ Response::** withCharset** ($charset)
908+ ` method ` Cake\\ Http\\ Response::** withCharset** ($charset): static
909909
910910Sets the charset that will be used in the response:
911911
@@ -915,7 +915,7 @@ $this->response = $this->response->withCharset('UTF-8');
915915
916916### Interacting with Browser Caching
917917
918- ` method ` Cake\\ Http\\ Response::** withDisabledCache** ()
918+ ` method ` Cake\\ Http\\ Response::** withDisabledCache** (): static
919919
920920You sometimes need to force browsers not to cache the results of a controller
921921action. ` Cake\Http\Response::withDisabledCache() ` is intended for just
@@ -933,7 +933,7 @@ public function index()
933933> Disabling caching from SSL domains while trying to send
934934> files to Internet Explorer can result in errors.
935935
936- ` method ` Cake\\ Http\\ Response::** withCache** ($since, $time = '+1 day')
936+ ` method ` Cake\\ Http\\ Response::** withCache** ($since, $time = '+1 day'): static
937937
938938You can also tell clients that you want them to cache responses. By using
939939` Cake\Http\Response::withCache() ` :
@@ -971,7 +971,7 @@ or reverse proxy caching.
971971
972972#### The Cache Control Header
973973
974- ` method ` Cake\\ Http\\ Response::** withSharable** ($public, $time = null)
974+ ` method ` Cake\\ Http\\ Response::** withSharable** ($public, $time = null): static
975975
976976Used under the expiration model, this header contains multiple indicators that
977977can change the way browsers or proxies use the cached content. A
@@ -1012,7 +1012,7 @@ the `Cache-Control` header.
10121012
10131013#### The Expiration Header
10141014
1015- ` method ` Cake\\ Http\\ Response::** withExpires** ($time)
1015+ ` method ` Cake\\ Http\\ Response::** withExpires** ($time): static
10161016
10171017You can set the ` Expires ` header to a date and time after which the response
10181018is no longer considered fresh. This header can be set using the
@@ -1030,7 +1030,7 @@ be parsed by the `DateTime` class.
10301030
10311031#### The Etag Header
10321032
1033- ` method ` Cake\\ Http\\ Response::** withEtag** ($tag, $weak = false)
1033+ ` method ` Cake\\ Http\\ Response::** withEtag** ($tag, $weak = false): static
10341034
10351035Cache validation in HTTP is often used when content is constantly changing, and
10361036asks the application to only generate the response contents if the cache is no
@@ -1073,7 +1073,7 @@ public function index()
10731073
10741074#### The Last Modified Header
10751075
1076- ` method ` Cake\\ Http\\ Response::** withModified** ($time)
1076+ ` method ` Cake\\ Http\\ Response::** withModified** ($time): static
10771077
10781078Also, under the HTTP cache validation model, you can set the ` Last-Modified `
10791079header to indicate the date and time at which the resource was modified for the
@@ -1099,7 +1099,7 @@ public function view()
10991099
11001100#### The Vary Header
11011101
1102- ` method ` Cake\\ Http\\ Response::** withVary** ($header)
1102+ ` method ` Cake\\ Http\\ Response::** withVary** ($header): static
11031103
11041104In some cases, you might want to serve different content using the same URL.
11051105This is often the case if you have a multilingual page or respond with different
@@ -1114,7 +1114,7 @@ $response = $this->response->withVary('Accept-Language');
11141114
11151115#### Sending Not-Modified Responses
11161116
1117- ` method ` Cake\\ Http\\ Response::** isNotModified** (Request $request)
1117+ ` method ` Cake\\ Http\\ Response::** isNotModified** (Request $request): bool
11181118
11191119Compares the cache headers for the request object with the cache header from the
11201120response and determines whether it can still be considered fresh. If so, deletes
0 commit comments