Skip to content

Commit f24e256

Browse files
Merge branch '6.4' into 7.0
* 6.4: Fix implicitly-required parameters minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents 465db01 + 5677bdf commit f24e256

30 files changed

+53
-53
lines changed

BinaryFileResponse.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class BinaryFileResponse extends Response
4242
* @param bool $autoEtag Whether the ETag header should be automatically set
4343
* @param bool $autoLastModified Whether the Last-Modified header should be automatically set
4444
*/
45-
public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true)
45+
public function __construct(\SplFileInfo|string $file, int $status = 200, array $headers = [], bool $public = true, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true)
4646
{
4747
parent::__construct(null, $status, $headers);
4848

@@ -60,7 +60,7 @@ public function __construct(\SplFileInfo|string $file, int $status = 200, array
6060
*
6161
* @throws FileException
6262
*/
63-
public function setFile(\SplFileInfo|string $file, string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true): static
63+
public function setFile(\SplFileInfo|string $file, ?string $contentDisposition = null, bool $autoEtag = false, bool $autoLastModified = true): static
6464
{
6565
if (!$file instanceof File) {
6666
if ($file instanceof \SplFileInfo) {

Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function fromString(string $cookie, bool $decode = false): static
7676
*
7777
* @param self::SAMESITE_*|''|null $sameSite
7878
*/
79-
public static function create(string $name, string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX, bool $partitioned = false): self
79+
public static function create(string $name, ?string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', ?string $domain = null, ?bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX, bool $partitioned = false): self
8080
{
8181
return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite, $partitioned);
8282
}
@@ -94,7 +94,7 @@ public static function create(string $name, string $value = null, int|string|\Da
9494
*
9595
* @throws \InvalidArgumentException
9696
*/
97-
public function __construct(string $name, string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', string $domain = null, bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX, bool $partitioned = false)
97+
public function __construct(string $name, ?string $value = null, int|string|\DateTimeInterface $expire = 0, ?string $path = '/', ?string $domain = null, ?bool $secure = null, bool $httpOnly = true, bool $raw = false, ?string $sameSite = self::SAMESITE_LAX, bool $partitioned = false)
9898
{
9999
// from PHP source code
100100
if ($raw && false !== strpbrk($name, self::RESERVED_CHARS_LIST)) {

Exception/SessionNotFoundException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class SessionNotFoundException extends \LogicException implements RequestExceptionInterface
2222
{
23-
public function __construct(string $message = 'There is currently no session available.', int $code = 0, \Throwable $previous = null)
23+
public function __construct(string $message = 'There is currently no session available.', int $code = 0, ?\Throwable $previous = null)
2424
{
2525
parent::__construct($message, $code, $previous);
2626
}

File/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getMimeType(): ?string
8282
*
8383
* @throws FileException if the target file could not be created
8484
*/
85-
public function move(string $directory, string $name = null): self
85+
public function move(string $directory, ?string $name = null): self
8686
{
8787
$target = $this->getTargetFile($directory, $name);
8888

@@ -112,7 +112,7 @@ public function getContent(): string
112112
return $content;
113113
}
114114

115-
protected function getTargetFile(string $directory, string $name = null): self
115+
protected function getTargetFile(string $directory, ?string $name = null): self
116116
{
117117
if (!is_dir($directory)) {
118118
if (false === @mkdir($directory, 0777, true) && !is_dir($directory)) {

File/UploadedFile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class UploadedFile extends File
6060
* @throws FileException If file_uploads is disabled
6161
* @throws FileNotFoundException If the file does not exist
6262
*/
63-
public function __construct(string $path, string $originalName, string $mimeType = null, int $error = null, bool $test = false)
63+
public function __construct(string $path, string $originalName, ?string $mimeType = null, ?int $error = null, bool $test = false)
6464
{
6565
$this->originalName = $this->getName($originalName);
6666
$this->mimeType = $mimeType ?: 'application/octet-stream';
@@ -158,7 +158,7 @@ public function isValid(): bool
158158
*
159159
* @throws FileException if, for any reason, the file could not have been moved
160160
*/
161-
public function move(string $directory, string $name = null): File
161+
public function move(string $directory, ?string $name = null): File
162162
{
163163
if ($this->isValid()) {
164164
if ($this->test) {

HeaderBag.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function __toString(): string
6565
*
6666
* @return ($key is null ? array<string, list<string|null>> : list<string|null>)
6767
*/
68-
public function all(string $key = null): array
68+
public function all(?string $key = null): array
6969
{
7070
if (null !== $key) {
7171
return $this->headers[strtr($key, self::UPPER, self::LOWER)] ?? [];
@@ -106,7 +106,7 @@ public function add(array $headers): void
106106
/**
107107
* Returns the first header by name or the default one.
108108
*/
109-
public function get(string $key, string $default = null): ?string
109+
public function get(string $key, ?string $default = null): ?string
110110
{
111111
$headers = $this->all($key);
112112

@@ -187,7 +187,7 @@ public function remove(string $key): void
187187
*
188188
* @throws \RuntimeException When the HTTP header is not parseable
189189
*/
190-
public function getDate(string $key, \DateTimeInterface $default = null): ?\DateTimeImmutable
190+
public function getDate(string $key, ?\DateTimeInterface $default = null): ?\DateTimeImmutable
191191
{
192192
if (null === $value = $this->get($key)) {
193193
return null !== $default ? \DateTimeImmutable::createFromInterface($default) : null;

InputBag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function set(string $key, mixed $value): void
8484
*
8585
* @return ?T
8686
*/
87-
public function getEnum(string $key, string $class, \BackedEnum $default = null): ?\BackedEnum
87+
public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum
8888
{
8989
try {
9090
return parent::getEnum($key, $class, $default);

ParameterBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function __construct(array $parameters = [])
3535
*
3636
* @param string|null $key The name of the parameter to return or null to get them all
3737
*/
38-
public function all(string $key = null): array
38+
public function all(?string $key = null): array
3939
{
4040
if (null === $key) {
4141
return $this->parameters;
@@ -161,7 +161,7 @@ public function getBoolean(string $key, bool $default = false): bool
161161
*
162162
* @return ?T
163163
*/
164-
public function getEnum(string $key, string $class, \BackedEnum $default = null): ?\BackedEnum
164+
public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum
165165
{
166166
$value = $this->get($key);
167167

Request.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public static function setFactory(?callable $callable): void
395395
* @param array|null $files The FILES parameters
396396
* @param array|null $server The SERVER parameters
397397
*/
398-
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static
398+
public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null): static
399399
{
400400
$dup = clone $this;
401401
if (null !== $query) {
@@ -1524,7 +1524,7 @@ public function getPreferredFormat(?string $default = 'html'): ?string
15241524
*
15251525
* @param string[] $locales An array of ordered available locales
15261526
*/
1527-
public function getPreferredLanguage(array $locales = null): ?string
1527+
public function getPreferredLanguage(?array $locales = null): ?string
15281528
{
15291529
$preferredLanguages = $this->getLanguages();
15301530

@@ -1917,7 +1917,7 @@ public function isFromTrustedProxy(): bool
19171917
* getPort(), isSecure(), getHost(), getClientIps(), getBaseUrl() etc. Thus, we try to cache the results for
19181918
* best performance.
19191919
*/
1920-
private function getTrustedValues(int $type, string $ip = null): array
1920+
private function getTrustedValues(int $type, ?string $ip = null): array
19211921
{
19221922
$cacheKey = $type."\0".((self::$trustedHeaderSet & $type) ? $this->headers->get(self::TRUSTED_HEADERS[$type]) : '');
19231923
$cacheKey .= "\0".$ip."\0".$this->headers->get(self::TRUSTED_HEADERS[self::HEADER_FORWARDED]);

Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function prepare(Request $request): static
311311
*
312312
* @return $this
313313
*/
314-
public function sendHeaders(int $statusCode = null): static
314+
public function sendHeaders(?int $statusCode = null): static
315315
{
316316
// headers have already been sent by the developer
317317
if (headers_sent()) {
@@ -471,7 +471,7 @@ public function getProtocolVersion(): string
471471
*
472472
* @final
473473
*/
474-
public function setStatusCode(int $code, string $text = null): static
474+
public function setStatusCode(int $code, ?string $text = null): static
475475
{
476476
$this->statusCode = $code;
477477
if ($this->isInvalid()) {
@@ -1249,7 +1249,7 @@ public function isNotFound(): bool
12491249
*
12501250
* @final
12511251
*/
1252-
public function isRedirect(string $location = null): bool
1252+
public function isRedirect(?string $location = null): bool
12531253
{
12541254
return \in_array($this->statusCode, [201, 301, 302, 303, 307, 308]) && (null === $location ?: $location == $this->headers->get('Location'));
12551255
}

0 commit comments

Comments
 (0)