8000 Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_… · symfony/browser-kit@2f6f979 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f6f979

Browse files
Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value
1 parent 0ed1f63 commit 2f6f979

10 files changed

+16
-16
lines changed

AbstractBrowser.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ abstract class AbstractBrowser
5050
/**
5151
* @param array $server The server parameters (equivalent of $_SERVER)
5252
*/
53-
public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null)
53+
public function __construct(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
5454
{
5555
$this->setServerParameters($server);
5656
$this->history = $history ?? new History();
@@ -146,7 +146,7 @@ public function getServerParameter(string $key, $default = '')
146146
return $this->server[$key] ?? $default;
147147
}
148148

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

@@ -352,7 +352,7 @@ public function submitForm(string $button, array $fieldValues = [], string $meth
352352
*
353353
* @return Crawler
354354
*/
355-
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true)
355+
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], ?string $content = null, bool $changeHistory = true)
356356
{
357357
if ($this->isMainRequest) {
358358
$this->redirectCount = 0;

Cookie.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Cookie
5555
* @param bool $encodedValue Whether the value is encoded or not
5656
* @param string|null $samesite The cookie samesite attribute
5757
*/
58-
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)
58+
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)
5959
{
6060
if ($encodedValue) {
6161
$this->value = urldecode($value);
@@ -125,7 +125,7 @@ public function __toString()
125125
*
126126
* @throws \InvalidArgumentException
127127
*/
128-
public static function fromString(string $cookie, string $url = null)
128+
public static function fromString(string $cookie, ?string $url = null)
129129
{
130130
$parts = explode(';', $cookie);
131131

CookieJar.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function set(Cookie $cookie)
3535
*
3636
* @return Cookie|null
3737
*/
38-
public function get(string $name, string $path = '/', string $domain = null)
38+
public function get(string $name, string $path = '/', ?string $domain = null)
3939
{
4040
$this->flushExpiredCookies();
4141

@@ -67,7 +67,7 @@ public function get(string $name, string $path = '/', string $domain = null)
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)
70+
public function expire(string $name, ?string $path = '/', ?string $domain = null)
7171
{
7272
if (null === $path) {
7373
$path = '/';
@@ -107,7 +107,7 @@ public function clear()
107107
*
108108
* @param string[] $setCookies Set-Cookie headers from an HTTP response
109109
*/
110-
public function updateFromSetCookie(array $setCookies, string $uri = null)
110+
public function updateFromSetCookie(array $setCookies, ?string $uri = null)
111111
{
112112
$cookies = [];
113113

@@ -133,7 +133,7 @@ public function updateFromSetCookie(array $setCookies, string $uri = null)
133133
/**
134134
* Updates the cookie jar from a Response object.
135135
*/
136-
public function updateFromResponse(Response $response, string $uri = null)
136+
public function updateFromResponse(Response $response, ?string $uri = null)
137137
{
138138
$this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri);
139139
}

HttpBrowser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class HttpBrowser extends AbstractBrowser
2828
{
2929
private $client;
3030

31-
public function __construct(HttpClientInterface $client = null, History $history = null, CookieJar $cookieJar = null)
31+
public function __construct(?HttpClientInterface $client = null, ?History $history = null, ?CookieJar $cookieJar = null)
3232
{
3333
if (!$client && !class_exists(HttpClient::class)) {
3434
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class BrowserCookieValueSame extends Constraint
2222
private $path;
2323
private $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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ final class BrowserHasCookie extends Constraint
2020
private $path;
2121
private $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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

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

Tests/HttpBrowserTest.php

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestHttpClient extends HttpBrowser
2323
protected $nextResponse = null;
2424
protected $nextScript = null;
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)
0