Skip to content

Commit 5677bdf

Browse files
Merge branch '6.3' into 6.4
* 6.3: 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
2 parents 292b163 + 3b72add commit 5677bdf

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
@@ -77,7 +77,7 @@ public static function fromString(string $cookie, bool $decode = false): static
7777
* @param self::SAMESITE_*|''|null $sameSite
7878
* @param bool $partitioned
7979
*/
80-
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
80+
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
8181
{
8282
$partitioned = 9 < \func_num_args() ? func_get_arg(9) : false;
8383

@@ -97,7 +97,7 @@ public static function create(string $name, string $value = null, int|string|\Da
9797
*
9898
* @throws \InvalidArgumentException
9999
*/
100-
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)
100+
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)
101101
{
102102
// from PHP source code
103103
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

@@ -197,7 +197,7 @@ public function remove(string $key)
197197
*
198198
* @throws \RuntimeException When the HTTP header is not parseable
199199
*/
200-
public function getDate(string $key, \DateTimeInterface $default = null): ?\DateTimeInterface
200+
public function getDate(string $key, ?\DateTimeInterface $default = null): ?\DateTimeInterface
201201
{
202202
if (null === $value = $this->get($key)) {
203203
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);

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
@@ -38,7 +38,7 @@ public function __construct(array $parameters = [])
3838
*
3939
* @param string|null $key The name of the parameter to return or null to get them all
4040
*/
41-
public function all(string $key = null): array
41+
public function all(?string $key = null): array
4242
{
4343
if (null === $key) {
4444
return $this->parameters;
@@ -174,7 +174,7 @@ public function getBoolean(string $key, bool $default = false): bool
174174
*
175175
* @return ?T
176176
*/
177-
public function getEnum(string $key, string $class, \BackedEnum $default = null): ?\BackedEnum
177+
public function getEnum(string $key, string $class, ?\BackedEnum $default = null): ?\BackedEnum
178178
{
179179
$value = $this->get($key);
180180

Request.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public static function setFactory(?callable $callable)
448448
* @param array|null $files The FILES parameters
449449
* @param array|null $server The SERVER parameters
450450
*/
451-
public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null): static
451+
public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null): static
452452
{
453453
$dup = clone $this;
454454
if (null !== $query) {
@@ -1606,7 +1606,7 @@ public function getPreferredFormat(?string $default = 'html'): ?string
16061606
*
16071607
* @param string[] $locales An array of ordered available locales
16081608
*/
1609-
public function getPreferredLanguage(array $locales = null): ?string
1609+
public function getPreferredLanguage(?array $locales = null): ?string
16101610
{
16111611
$preferredLanguages = $this->getLanguages();
16121612

@@ -2004,7 +2004,7 @@ public function isFromTrustedProxy(): bool
20042004
* getPort(), isSecure(), getHost(), getClientIps(), getBaseUrl() etc. Thus, we try to cache the results for
20052005
* best performance.
20062006
*/
2007-
private function getTrustedValues(int $type, string $ip = null): array
2007+
private function getTrustedValues(int $type, ?string $ip = null): array
20082008
{
20092009
$cacheKey = $type."\0".((self::$trustedHeaderSet & $type) ? $this->headers->get(self::TRUSTED_HEADERS[$type]) : '');
20102010
$cacheKey .= "\0".$ip."\0".$this->headers->get(self::TRUSTED_HEADERS[self::HEADER_FORWARDED]);

0 commit comments

Comments
 (0)