Skip to content

Commit 867868f

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 e270297 + 2f6f979 commit 867868f

10 files changed

+16
-16
lines changed

AbstractBrowser.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ abstract class AbstractBrowser
5454
/**
5555
* @param array $server The server parameters (equivalent of $_SERVER)
5656
*/
57-
public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null)
57+
public function __construct(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
5858
{
5959
$this->setServerParameters($server);
6060
$this->history = $history ?? new History();
@@ -154,7 +154,7 @@ public function getServerParameter(string $key, mixed $default = ''): mixed
154154
return $this->server[$key] ?? $default;
155155
}
156156

157-
public function xmlHttpRequest(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true): Crawler
157+
public function xmlHttpRequest(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], ?string $content = null, bool $changeHistory = true): Crawler
158158
{
159159
$this->setServerParameter('HTTP_X_REQUESTED_WITH', 'XMLHttpRequest');
160160

@@ -357,7 +357,7 @@ public function submitForm(string $button, array $fieldValues = [], string $meth
357357
* @param string $content The raw body data
358358
* @param bool $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
359359
*/
360-
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true): Crawler
360+
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], ?string $content = null, bool $changeHistory = true): Crawler
361361
{
362362
if ($this->isMainRequest) {
363363
$this->redirectCount = 0;

Cookie.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Cookie
5858
* @param bool $encodedValue Whether the value is encoded or not
5959
* @param string|null $samesite The cookie samesite attribute
6060
*/
61-
public function __construct(string $name, ?string $value, string $expires = null, string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false, string $samesite = null)
61+
public function __construct(string $name, ?string $value, ?string $expires = null, ?string $path = null, string $domain = '', bool $secure = false, bool $httponly = true, bool $encodedValue = false, ?string $samesite = null)
6262
{
6363
if ($encodedValue) {
6464
$this->value = urldecode($value);
@@ -124,7 +124,7 @@ public function __toString(): string
124124
*
125125
* @throws InvalidArgumentException
126126
*/
127-
public static function fromString(string $cookie, string $url = null): static
127+
public static function fromString(string $cookie, ?string $url = null): static
128128
{
129129
$parts = explode(';', $cookie);
130130

CookieJar.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function set(Cookie $cookie)
3838
* (this behavior ensures a BC behavior with previous versions of
3939
* Symfony).
4040
*/
41-
public function get(string $name, string $path = '/', string $domain = null): ?Cookie
41+
public function get(string $name, string $path = '/', ?string $domain = null): ?Cookie
4242
{
4343
$this->flushExpiredCookies();
4444

@@ -72,7 +72,7 @@ public function get(string $name, string $path = '/', string $domain = null): ?C
7272
*
7373
* @return void
7474
*/
75-
public function expire(string $name, ?string $path = '/', string $domain = null)
75+
public function expire(string $name, ?string $path = '/', ?string $domain = null)
7676
{
7777
$path ??= '/';
7878

@@ -114,7 +114,7 @@ public function clear()
114114
*
115115
* @return void
116116
*/
117-
public function updateFromSetCookie(array $setCookies, string $uri = null)
117+
public function updateFromSetCookie(array $setCookies, ?string $uri = null)
118118
{
119119
$cookies = [];
120120

@@ -142,7 +142,7 @@ public function updateFromSetCookie(array $setCookies, string $uri = null)
142142
*
143143
* @return void
144144
*/
145-
public function updateFromResponse(Response $response, string $uri = null)
145+
public function updateFromResponse(Response $response, ?string $uri = null)
146146
{
147147
$this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri);
148148
}

HttpBrowser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class HttpBrowser extends AbstractBrowser
2929
{
3030
private HttpClientInterface $client;
3131

32-
public function __construct(HttpClientInterface $client = null, History $history = null, CookieJar $cookieJar = null)
32+
public function __construct(?HttpClientInterface $client = null, ?History $history = null, ?CookieJar $cookieJar = null)
3333
{
3434
if (!$client && !class_exists(HttpClient::class)) {
3535
throw new LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));

Request.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Request
3333
* @param array $server An array of server parameters
3434
* @param string $content The raw body data
3535
*/
36-
public function __construct(string $uri, string $method, array $parameters = [], array $files = [], array $cookies = [], array $server = [], string $content = null)
36+
public function __construct(string $uri, string $method, array $parameters = [], array $files = [], array $cookies = [], array $server = [], ?string $content = null)
3737
{
3838
$this->uri = $uri;
3939
$this->method = $method;

Test/Constraint/BrowserCookieValueSame.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class BrowserCookieValueSame extends Constraint
2222
private string $path;
2323
private ?string $domain;
2424

25-
public function __construct(string $name, string $value, bool $raw = false, string $path = '/', string $domain = null)
25+
public function __construct(string $name, string $value, bool $raw = false, string $path = '/', ?string $domain = null)
2626
{
2727
$this->name = $name;
2828
$this->path = $path;

Test/Constraint/BrowserHasCookie.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class BrowserHasCookie extends Constraint
2020
private string $path;
2121
private ?string $domain;
2222

23-
public function __construct(string $name, string $path = '/', string $domain = null)
23+
public function __construct(string $name, string $path = '/', ?string $domain = null)
2424
{
2525
$this->name = $name;
2626
$this->path = $path;

Tests/AbstractBrowserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class AbstractBrowserTest extends TestCase
2323
{
24-
public function getBrowser(array $server = [], History $history = null, CookieJar $cookieJar = null)
24+
public function getBrowser(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
2525
{
2626
return new TestClient($server, $history, $cookieJar);
2727
}

Tests/HttpBrowserTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
class HttpBrowserTest extends AbstractBrowserTest
2121
{
22-
public function getBrowser(array $server = [], History $history = null, CookieJar $cookieJar = null)
22+
public function getBrowser(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
2323
{
2424
return new TestHttpClient($server, $history, $cookieJar);
2525
}

Tests/TestHttpClient.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestHttpClient extends HttpBrowser
2323
protected $nextResponse;
2424
protected $nextScript;
2525

26-
public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null)
26+
public function __construct(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
2727
{
2828
$client = new MockHttpClient(function (string $method, string $url, array $options) {
2929
if (null === $this->nextResponse) {

0 commit comments

Comments
 (0)