Skip to content

Commit

Permalink
Merge branch '6.3' into 6.4
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents a3bb210 + 867868f commit 495ffa2
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions AbstractBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ abstract class AbstractBrowser
/**
* @param array $server The server parameters (equivalent of $_SERVER)
*/
public function __construct(array $server = [], History $history = null, CookieJar $cookieJar = null)
public function __construct(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
{
$this->setServerParameters($server);
$this->history = $history ?? new History();
Expand Down Expand Up @@ -154,7 +154,7 @@ public function getServerParameter(string $key, mixed $default = ''): mixed
return $this->server[$key] ?? $default;
}

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

Expand Down Expand Up @@ -339,7 +339,7 @@ public function submitForm(string $button, array $fieldValues = [], string $meth
* @param string $content The raw body data
* @param bool $changeHistory Whether to update the history or not (only used internally for back(), forward(), and reload())
*/
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], string $content = null, bool $changeHistory = true): Crawler
public function request(string $method, string $uri, array $parameters = [], array $files = [], array $server = [], ?string $content = null, bool $changeHistory = true): Crawler
{
if ($this->isMainRequest) {
$this->redirectCount = 0;
Expand Down
4 changes: 2 additions & 2 deletions Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Cookie
* @param bool $encodedValue Whether the value is encoded or not
* @param string|null $samesite The cookie samesite attribute
*/
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)
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)
{
if ($encodedValue) {
$this->rawValue = $value ?? '';
Expand Down Expand Up @@ -124,7 +124,7 @@ public function __toString(): string
*
* @throws InvalidArgumentException
*/
public static function fromString(string $cookie, string $url = null): static
public static function fromString(string $cookie, ?string $url = null): static
{
$parts = explode(';', $cookie);

Expand Down
8 changes: 4 additions & 4 deletions CookieJar.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function set(Cookie $cookie)
* (this behavior ensures a BC behavior with previous versions of
* Symfony).
*/
public function get(string $name, string $path = '/', string $domain = null): ?Cookie
public function get(string $name, string $path = '/', ?string $domain = null): ?Cookie
{
$this->flushExpiredCookies();

Expand Down Expand Up @@ -72,7 +72,7 @@ public function get(string $name, string $path = '/', string $domain = null): ?C
*
* @return void
*/
public function expire(string $name, ?string $path = '/', string $domain = null)
public function expire(string $name, ?string $path = '/', ?string $domain = null)
{
$path ??= '/';

Expand Down Expand Up @@ -114,7 +114,7 @@ public function clear()
*
* @return void
*/
public function updateFromSetCookie(array $setCookies, string $uri = null)
public function updateFromSetCookie(array $setCookies, ?string $uri = null)
{
$cookies = [];

Expand Down Expand Up @@ -142,7 +142,7 @@ public function updateFromSetCookie(array $setCookies, string $uri = null)
*
* @return void
*/
public function updateFromResponse(Response $response, string $uri = null)
public function updateFromResponse(Response $response, ?string $uri = null)
{
$this->updateFromSetCookie($response->getHeader('Set-Cookie', false), $uri);
}
Expand Down
2 changes: 1 addition & 1 deletion HttpBrowser.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class HttpBrowser extends AbstractBrowser
{
private HttpClientInterface $client;

public function __construct(HttpClientInterface $client = null, History $history = null, CookieJar $cookieJar = null)
public function __construct(?HttpClientInterface $client = null, ?History $history = null, ?CookieJar $cookieJar = null)
{
if (!$client && !class_exists(HttpClient::class)) {
throw new LogicException(sprintf('You cannot use "%s" as the HttpClient component is not installed. Try running "composer require symfony/http-client".', __CLASS__));
Expand Down
2 changes: 1 addition & 1 deletion Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Request
* @param array $server An array of server parameters
* @param string $content The raw body data
*/
public function __construct(string $uri, string $method, array $parameters = [], array $files = [], array $cookies = [], array $server = [], string $content = null)
public function __construct(string $uri, string $method, array $parameters = [], array $files = [], array $cookies = [], array $server = [], ?string $content = null)
{
$this->uri = $uri;
$this->method = $method;
Expand Down
2 changes: 1 addition & 1 deletion Test/Constraint/BrowserCookieValueSame.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class BrowserCookieValueSame extends Constraint
private string $path;
private ?string $domain;

public function __construct(string $name, string $value, bool $raw = false, string $path = '/', string $domain = null)
public function __construct(string $name, string $value, bool $raw = false, string $path = '/', ?string $domain = null)
{
$this->name = $name;
$this->path = $path;
Expand Down
2 changes: 1 addition & 1 deletion Test/Constraint/BrowserHasCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ final class BrowserHasCookie extends Constraint
private string $path;
private ?string $domain;

public function __construct(string $name, string $path = '/', string $domain = null)
public function __construct(string $name, string $path = '/', ?string $domain = null)
{
$this->name = $name;
$this->path = $path;
Expand Down
2 changes: 1 addition & 1 deletion Tests/AbstractBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

class AbstractBrowserTest extends TestCase
{
public function getBrowser(array $server = [], History $history = null, CookieJar $cookieJar = null)
public function getBrowser(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
{
return new TestClient($server, $history, $cookieJar);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/HttpBrowserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class HttpBrowserTest extends AbstractBrowserTest
{
public function getBrowser(array $server = [], History $history = null, CookieJar $cookieJar = null)
public function getBrowser(array $server = [], ?History $history = null, ?CookieJar $cookieJar = null)
{
return new TestHttpClient($server, $history, $cookieJar);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/TestHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestHttpClient extends HttpBrowser
protected ?Response $nextResponse = null;
protected string $nextScript;

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

0 comments on commit 495ffa2

Please sign in to comment.