Skip to content

Commit 3330a8f

Browse files
Merge branch '6.4' into 7.0
* 6.4: 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 d13205f + 6db3184 commit 3330a8f

5 files changed

+12
-12
lines changed

AbstractUriElement.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abstract class AbstractUriElement
2929
*
3030
* @throws \InvalidArgumentException if the node is not a link
3131
*/
32-
public function __construct(\DOMElement $node, string $currentUri = null, ?string $method = 'GET')
32+
public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = 'GET')
3333
{
3434
$this->setNode($node);
3535
$this->method = $method ? strtoupper($method) : null;

Crawler.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Crawler implements \Countable, \IteratorAggregate
6060
/**
6161
* @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling
6262
*/
63-
public function __construct(\DOMNodeList|\DOMNode|array|string $node = null, string $uri = null, string $baseHref = null, bool $useHtml5Parser = true)
63+
public function __construct(\DOMNodeList|\DOMNode|array|string|null $node = null, ?string $uri = null, ?string $baseHref = null, bool $useHtml5Parser = true)
6464
{
6565
$this->uri = $uri;
6666
$this->baseHref = $baseHref ?: $uri;
@@ -128,7 +128,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node): void
128128
* or ISO-8859-1 as a fallback, which is the default charset defined by the
129129
* HTTP 1.1 specification.
130130
*/
131-
public function addContent(string $content, string $type = null): void
131+
public function addContent(string $content, ?string $type = null): void
132132
{
133133
if (empty($type)) {
134134
$type = str_starts_with($content, '<?xml') ? 'application/xml' : 'text/html';
@@ -329,7 +329,7 @@ public function each(\Closure $closure): array
329329
/**
330330
* Slices the list of nodes by $offset and $length.
331331
*/
332-
public function slice(int $offset = 0, int $length = null): static
332+
public function slice(int $offset = 0, ?int $length = null): static
333333
{
334334
return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length));
335335
}
@@ -479,7 +479,7 @@ public function ancestors(): static
479479
* @throws \InvalidArgumentException When current node is empty
480480
* @throws \RuntimeException If the CssSelector Component is not available and $selector is provided
481481
*/
482-
public function children(string $selector = null): static
482+
public function children(?string $selector = null): static
483483
{
484484
if (!$this->nodes) {
485485
throw new \InvalidArgumentException('The current node list is empty.');
@@ -504,7 +504,7 @@ public function children(string $selector = null): static
504504
*
505505
* @throws \InvalidArgumentException When current node is empty
506506
*/
507-
public function attr(string $attribute, string $default = null): ?string
507+
public function attr(string $attribute, ?string $default = null): ?string
508508
{
509509
if (!$this->nodes) {
510510
if (null !== $default) {
@@ -543,7 +543,7 @@ public function nodeName(): string
543543
*
544544
* @throws \InvalidArgumentException When current node is empty
545545
*/
546-
public function text(string $default = null, bool $normalizeWhitespace = true): string
546+
public function text(?string $default = null, bool $normalizeWhitespace = true): string
547547
{
548548
if (!$this->nodes) {
549549
if (null !== $default) {
@@ -591,7 +591,7 @@ public function innerText(bool $normalizeWhitespace = true): string
591591
*
592592
* @throws \InvalidArgumentException When current node is empty
593593
*/
594-
public function html(string $default = null): string
594+
public function html(?string $default = null): string
595595
{
596596
if (!$this->nodes) {
597597
if (null !== $default) {
@@ -840,7 +840,7 @@ public function images(): array
840840
*
841841
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
842842
*/
843-
public function form(array $values = null, string $method = null): Form
843+
public function form(?array $values = null, ?string $method = null): Form
844844
{
845845
if (!$this->nodes) {
846846
throw new \InvalidArgumentException('The current node list is empty.');

Form.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Form extends Link implements \ArrayAccess
3333
*
3434
* @throws \LogicException if the node is not a button inside a form tag
3535
*/
36-
public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null)
36+
public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = null, ?string $baseHref = null)
3737
{
3838
parent::__construct($node, $currentUri, $method);
3939
$this->baseHref = $baseHref;

Image.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
class Image extends AbstractUriElement
1818
{
19-
public function __construct(\DOMElement $node, string $currentUri = null)
19+
public function __construct(\DOMElement $node, ?string $currentUri = null)
2020
{
2121
parent::__construct($node, $currentUri, 'GET');
2222
}

Tests/AbstractCrawlerTestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ abstract class AbstractCrawlerTestCase extends TestCase
2121
{
2222
abstract public static function getDoctype(): string;
2323

24-
protected function createCrawler($node = null, string $uri = null, string $baseHref = null, bool $useHtml5Parser = true)
24+
protected function createCrawler($node = null, ?string $uri = null, ?string $baseHref = null, bool $useHtml5Parser = true)
2525
{
2626
return new Crawler($node, $uri, $baseHref, $useHtml5Parser);
2727
}

0 commit comments

Comments
 (0)