@@ -75,7 +75,7 @@ are also all found in the routing parameters:
7575
7676### Query String Parameters
7777
78- ` method ` Cake\\ Http\\ ServerRequest::** getQuery** ($name, $default = null): mixed
78+ ` method ` Cake\\ Http\\ ServerRequest::** getQuery** (?string $name = null, mixed $default = null): mixed
7979
8080Query string parameters can be read using the ` getQuery() ` method:
8181
@@ -135,7 +135,7 @@ Casting functions were added.
135135
136136### Request Body Data
137137
138- ` method ` Cake\\ Http\\ ServerRequest::** getData** ($name, $default = null): mixed
138+ ` method ` Cake\\ Http\\ ServerRequest::** getData** (?string $name = null, mixed $default = null): mixed
139139
140140All POST data normally available through PHP's ` $_POST ` global variable can be
141141accessed using ` Cake\Http\ServerRequest::getData() ` . For example:
@@ -210,7 +210,7 @@ necessary. In an CLI environment, where the concept of uploading files doesn't
210210exist, it will allow to move the file that you've referenced irrespective of its
211211origins, which makes testing file uploads possible.
212212
213- ` method ` Cake\\ Http\\ ServerRequest::** getUploadedFile** ($path): UploadedFileInterface|null
213+ ` method ` Cake\\ Http\\ ServerRequest::** getUploadedFile** (string $path): UploadedFileInterface|null
214214
215215Returns the uploaded file at a specific path. The path uses the same dot syntax as the
216216` Cake\Http\ServerRequest::getData() ` method:
@@ -296,7 +296,7 @@ types making the parsed data available in `$request->getData()` and
296296
297297### Environment Variables (from $_ SERVER and $_ ENV)
298298
299- ` method ` Cake\\ Http\\ ServerRequest::** getEnv** ($key, $default = null): string|null
299+ ` method ` Cake\\ Http\\ ServerRequest::** getEnv** (string $key, ?string $default = null): string|null
300300
301301` ServerRequest::getEnv() ` is a wrapper for ` getenv() ` global function and acts as
302302a getter for environment variables without possible undefined keys:
@@ -311,7 +311,7 @@ To access all the environment variables in a request use `getServerParams()`:
311311$env = $this->request->getServerParams();
312312```
313313
314- ` method ` Cake\\ Http\\ ServerRequest::** withEnv** ($key, $value): static
314+ ` method ` Cake\\ Http\\ ServerRequest::** withEnv** (string $key, string $value): static
315315
316316` ServerRequest::withEnv() ` is a wrapper for ` putenv() ` global function and acts as
317317a setter for environment variables without having to modify globals
@@ -368,7 +368,7 @@ $base = $request->getAttribute('webroot');
368368
369369### Checking Request Conditions
370370
371- ` method ` Cake\\ Http\\ ServerRequest::** is** ($type, $args ...): bool
371+ ` method ` Cake\\ Http\\ ServerRequest::** is** (array|string $type, mixed ...$args ): bool
372372
373373The request object provides a way to inspect certain conditions in a given
374374request. By using the ` is() ` method you can check a number of common
@@ -395,7 +395,7 @@ detectors. There are different types of detectors that you can create:
395395 to handle the check. The callback will receive the request object as its only
396396 parameter.
397397
398- ` method ` Cake\\ Http\\ ServerRequest::** addDetector** ($name, $options): void
398+ ` method ` Cake\\ Http\\ ServerRequest::** addDetector** (string $name, Closure|array $options): void
399399
400400Some examples would be:
401401
@@ -492,7 +492,7 @@ to use the session object.
492492
493493### Host and Domain Name
494494
495- ` method ` Cake\\ Http\\ ServerRequest::** domain** ($tldLength = 1): string
495+ ` method ` Cake\\ Http\\ ServerRequest::** domain** (int $tldLength = 1): string
496496
497497Returns the domain name your application is running on:
498498
@@ -501,7 +501,7 @@ Returns the domain name your application is running on:
501501echo $request->domain();
502502```
503503
504- ` method ` Cake\\ Http\\ ServerRequest::** subdomains** ($tldLength = 1): array
504+ ` method ` Cake\\ Http\\ ServerRequest::** subdomains** (int $tldLength = 1): array
505505
506506Returns the subdomains your application is running on as an array:
507507
@@ -532,7 +532,7 @@ echo $request->getMethod();
532532
533533### Restricting Which HTTP method an Action Accepts
534534
535- ` method ` Cake\\ Http\\ ServerRequest::** allowMethod** ($methods): bool
535+ ` method ` Cake\\ Http\\ ServerRequest::** allowMethod** (array|string $methods): bool
536536
537537Set allowed HTTP methods. If not matched, will throw
538538` MethodNotAllowedException ` . The 405 response will include the required
@@ -566,7 +566,7 @@ $hasAcceptHeader = $this->request->hasHeader('Accept');
566566While some apache installs don't make the ` Authorization ` header accessible,
567567CakePHP will make it available through apache specific methods as required.
568568
569- ` method ` Cake\\ Http\\ ServerRequest::** referer** ($local = true): string|null
569+ ` method ` Cake\\ Http\\ ServerRequest::** referer** (bool $local = true): string|null
570570
571571Returns the referring address for the request.
572572
@@ -608,7 +608,7 @@ proxy.
608608
609609### Checking Accept Headers
610610
611- ` method ` Cake\\ Http\\ ServerRequest::** accepts** ($type = null): array|bool
611+ ` method ` Cake\\ Http\\ ServerRequest::** accepts** (?string $type = null): array|bool
612612
613613Find out which content types the client accepts, or check whether it accepts a
614614particular type of content.
@@ -625,7 +625,7 @@ Check for a single type:
625625$acceptsJson = $this->request->accepts('application/json');
626626```
627627
628- ` method ` Cake\\ Http\\ ServerRequest::** acceptLanguage** ($language = null): array|bool
628+ ` method ` Cake\\ Http\\ ServerRequest::** acceptLanguage** (?string $language = null): array|bool
629629
630630Get all the languages accepted by the client,
631631or check whether a specific language is accepted.
@@ -717,7 +717,7 @@ tasks such as:
717717
718718### Dealing with Content Types
719719
720- ` method ` Cake\\ Http\\ Response::** withType** ($contentType = null ): static
720+ ` method ` Cake\\ Http\\ Response::** withType** (string $contentType): static
721721
722722You can control the Content-Type of your application's responses with
723723` Cake\Http\Response::withType() ` . If your application needs to deal
@@ -836,7 +836,7 @@ redirect location header.
836836
837837### Setting the Body
838838
839- ` method ` Cake\\ Http\\ Response::** withStringBody** ($string): static
839+ ` method ` Cake\\ Http\\ Response::** withStringBody** (string $string): static
840840
841841To set a string as the response body, do the following:
842842
@@ -891,7 +891,7 @@ $response = $response->withBody($stream);
891891
892892### Setting the Character Set
893893
894- ` method ` Cake\\ Http\\ Response::** withCharset** ($charset): static
894+ ` method ` Cake\\ Http\\ Response::** withCharset** (string $charset): static
895895
896896Sets the charset that will be used in the response:
897897
@@ -919,7 +919,7 @@ public function index()
919919> Disabling caching from SSL domains while trying to send
920920> files to Internet Explorer can result in errors.
921921
922- ` method ` Cake\\ Http\\ Response::** withCache** ($since, $time = '+1 day'): static
922+ ` method ` Cake\\ Http\\ Response::** withCache** (string $since, string $time = '+1 day'): static
923923
924924You can also tell clients that you want them to cache responses. By using
925925` Cake\Http\Response::withCache() ` :
@@ -957,7 +957,7 @@ or reverse proxy caching.
957957
958958#### The Cache Control Header
959959
960- ` method ` Cake\\ Http\\ Response::** withSharable** ($public, $time = null): static
960+ ` method ` Cake\\ Http\\ Response::** withSharable** (bool $public, ?int $time = null): static
961961
962962Used under the expiration model, this header contains multiple indicators that
963963can change the way browsers or proxies use the cached content. A
@@ -998,7 +998,7 @@ the `Cache-Control` header.
998998
999999#### The Expiration Header
10001000
1001- ` method ` Cake\\ Http\\ Response::** withExpires** ($time): static
1001+ ` method ` Cake\\ Http\\ Response::** withExpires** (DateTimeInterface|string $time): static
10021002
10031003You can set the ` Expires ` header to a date and time after which the response
10041004is no longer considered fresh. This header can be set using the
@@ -1016,7 +1016,7 @@ be parsed by the `DateTime` class.
10161016
10171017#### The Etag Header
10181018
1019- ` method ` Cake\\ Http\\ Response::** withEtag** ($tag, $weak = false): static
1019+ ` method ` Cake\\ Http\\ Response::** withEtag** (string $tag, bool $weak = false): static
10201020
10211021Cache validation in HTTP is often used when content is constantly changing, and
10221022asks the application to only generate the response contents if the cache is no
@@ -1059,7 +1059,7 @@ public function index()
10591059
10601060#### The Last Modified Header
10611061
1062- ` method ` Cake\\ Http\\ Response::** withModified** ($time): static
1062+ ` method ` Cake\\ Http\\ Response::** withModified** (DateTimeInterface|string $time): static
10631063
10641064Also, under the HTTP cache validation model, you can set the ` Last-Modified `
10651065header to indicate the date and time at which the resource was modified for the
@@ -1085,7 +1085,7 @@ public function view()
10851085
10861086#### The Vary Header
10871087
1088- ` method ` Cake\\ Http\\ Response::** withVary** ($header): static
1088+ ` method ` Cake\\ Http\\ Response::** withVary** (string $header): static
10891089
10901090In some cases, you might want to serve different content using the same URL.
10911091This is often the case if you have a multilingual page or respond with different
@@ -1100,7 +1100,7 @@ $response = $this->response->withVary('Accept-Language');
11001100
11011101#### Sending Not-Modified Responses
11021102
1103- ` method ` Cake\\ Http\\ Response::** isNotModified** (Request $request): bool
1103+ ` method ` Cake\\ Http\\ Response::** isNotModified** (ServerRequest $request): bool
11041104
11051105Compares the cache headers for the request object with the cache header from the
11061106response and determines whether it can still be considered fresh. If so, deletes
0 commit comments