Skip to content

Commit 3b72add

Browse files
Merge branch '5.4' into 6.3
* 5.4: 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 25639a4 + f2ab692 commit 3b72add

32 files changed

+59
-59
lines changed

BinaryFileResponse.php

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

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

Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static function fromString(string $cookie, bool $decode = false): static
7474
*
7575
* @param self::SAMESITE_*|''|null $sameSite
7676
*/
77-
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): self
77+
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): self
7878
{
7979
return new self($name, $value, $expire, $path, $domain, $secure, $httpOnly, $raw, $sameSite);
8080
}
@@ -92,7 +92,7 @@ public static function create(string $name, string $value = null, int|string|\Da
9292
*
9393
* @throws \InvalidArgumentException
9494
*/
95-
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)
95+
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)
9696
{
9797
// from PHP source code
9898
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)] ?? [];
@@ -110,7 +110,7 @@ public function add(array $headers)
110110
/**
111111
* Returns the first header by name or the default one.
112112
*/
113-
public function get(string $key, string $default = null): ?string
113+
public function get(string $key, ?string $default = null): ?string
114114
{
115115
$headers = $this->all($key);
116116

@@ -195,7 +195,7 @@ public function remove(string $key)
195195
*
196196
* @throws \RuntimeException When the HTTP header is not parseable
197197
*/
198-
public function getDate(string $key, \DateTime $default = null): ?\DateTimeInterface
198+
public function getDate(string $key, ?\DateTime $default = null): ?\DateTimeInterface
199199
{
200200
if (null === $value = $this->get($key)) {
201201
return $default;

InputBag.php

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

JsonResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public static function fromJsonString(string $data, int $status = 200, array $he
7575
*
7676
* @throws \InvalidArgumentException When the callback name is not valid
7777
*/
78-
public function setCallback(string $callback = null): static
78+
public function setCallback(?string $callback = null): static
7979
{
8080
if (1 > \func_num_args()) {
8181
trigger_deprecation('symfony/http-foundation', '6.2', 'Calling "%s()" without any arguments is deprecated, pass null explicitly instead.', __METHOD__);

ParameterBag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(array $parameters = [])
3737
*
3838
* @param string|null $key The name of the parameter to return or null to get them all
3939
*/
40-
public function all(string $key = null): array
40+
public function all(?string $key = null): array
4141
{
4242
if (null === $key) {
4343
return $this->parameters;
@@ -173,7 +173,7 @@ public function getBoolean(string $key, bool $default = false): bool
173173
*
174174
* @return ?T
175175
*/
176-
public function getEnum(string $key, string $class, \BackedEnum $default = null): ?\BackedEnum
176+
public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum
177177
{
178178
$value = $this->get($key);
179179

Request.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public static function setFactory(?callable $callable)
446446
* @param array|null $files The FILES parameters
447447
* @param array|null $server The SERVER parameters
448448
*/
449-
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static
449+
public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null): static
450450
{
451451
$dup = clone $this;
452452
if (null !== $query) {
@@ -1604,7 +1604,7 @@ public function getPreferredFormat(?string $default = 'html'): ?string
16041604
*
16051605
* @param string[] $locales An array of ordered available locales
16061606
*/
1607-
public function getPreferredLanguage(array $locales = null): ?string
1607+
public function getPreferredLanguage(?array $locales = null): ?string
16081608
{
16091609
$preferredLanguages = $this->getLanguages();
16101610

@@ -2009,7 +2009,7 @@ public function isFromTrustedProxy(): bool
20092009
return self::$trustedProxies && IpUtils::checkIp($this->server->get('REMOTE_ADDR', ''), self::$trustedProxies);
20102010
}
20112011

2012-
private function getTrustedValues(int $type, string $ip = null): array
2012+
private function getTrustedValues(int $type, ?string $ip = null): array
20132013
{
20142014
$clientValues = [];
20152015
$forwardedValues = [];

0 commit comments

Comments
 (0)