Skip to content

Commit 38da196

Browse files
Merge branch '7.0' into 7.1
* 7.0: List CS fix in .git-blame-ignore-revs 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 a7ab73b + 725d5b1 commit 38da196

9 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();
@@ -142,7 +142,7 @@ public function getServerParameter(string $key, mixed $default = ''): mixed
142142
return $this->server[$key] ?? $default;
143143
}
144144

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

@@ -323,7 +323,7 @@ public function submitForm(string $button, array $fieldValues = [], string $meth
323323
* @param string $content The raw body data
324324
* @param bool $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
325325
*/
326-
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true): Crawler
326+
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], ?string $content = null, bool $changeHistory = true): Crawler
327327
{
328328
if ($this->isMainRequest) {
329329
$this->redirectCount = 0;

Cookie.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ class Cookie
5656
public function __construct(
5757
private string $name,
5858
?string $value,
59-
string $expires = null,
60-
string $path = null,
59+
?string $expires = null,
60+
?string $path = null,
6161
private string $domain = '',
6262
private bool $secure = false,
6363
private bool $httponly = true,
@@ -123,7 +123,7 @@ public function __toString(): string
123123
*
124124
* @throws InvalidArgumentException
125125
*/
126-
public static function fromString(string $cookie, string $url = null): static
126+
public static function fromString(string $cookie, ?string $url = null): static
127127
{
128128
$parts = explode(';', $cookie);
129129

CookieJar.php

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

@@ -67,7 +67,7 @@ public function get(string $name, string $path = '/', string $domain = null): ?C
6767
* all cookies for the given name/path expire (this behavior
6868
* ensures a BC behavior with previous versions of Symfony).
6969
*/
70-
public function expire(string $name, ?string $path = '/', string $domain = null): void
70+
public function expire(string $name, ?string $path = '/', ?string $domain = null): void
7171
{
7272
$path ??= '/';
7373

@@ -105,7 +105,7 @@ public function clear(): void
105105
*
106106
* @param string[] $setCookies Set-Cookie headers from an HTTP response
107107
*/
108-
public function updateFromSetCookie(array $setCookies, string $uri = null): void
108+
public function updateFromSetCookie(array $setCookies, ?string $uri = null): void
109109
{
110110
$cookies = [];
111111

@@ -131,7 +131,7 @@ public function updateFromSetCookie(array $setCookies, string $uri = null): void
131131
/**
132132
* Updates the cookie jar from a Response object.
133133
*/
134-
public function updateFromResponse(Response $response, string $uri = null): void
134+
public function updateFromResponse(Response $response, ?string $uri = null): void
135135
{
136136
$this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri);
137137
}

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__));

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 ?Response $nextResponse = null;
2424
protected string $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)