Skip to content

Commit e412abb

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 b7065c1 + e3b4806 commit e412abb

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

AbstractUriElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class AbstractUriElement
4040
*
4141
* @throws \InvalidArgumentException if the node is not a link
4242
*/
43-
public function __construct(\DOMElement $node, string $currentUri = null, ?string $method = 'GET')
43+
public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = 'GET')
4444
{
4545
$this->setNode($node);
4646
$this->method = $method ? strtoupper($method) : null;

Crawler.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Crawler implements \Countable, \IteratorAggregate
6464
/**
6565
* @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling
6666
*/
67-
public function __construct(\DOMNodeList|\DOMNode|array|string $node = null, string $uri = null, string $baseHref = null, bool $useHtml5Parser = true)
67+
public function __construct(\DOMNodeList|\DOMNode|array|string|null $node = null, ?string $uri = null, ?string $baseHref = null, bool $useHtml5Parser = true)
6868
{
6969
$this->uri = $uri;
7070
$this->baseHref = $baseHref ?: $uri;
@@ -138,7 +138,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node)
138138
*
139139
* @return void
140140
*/
141-
public function addContent(string $content, string $type = null)
141+
public function addContent(string $content, ?string $type = null)
142142
{
143143
if (empty($type)) {
144144
$type = str_starts_with($content, '<?xml') ? 'application/xml' : 'text/html';
@@ -351,7 +351,7 @@ public function each(\Closure $closure): array
351351
/**
352352
* Slices the list of nodes by $offset and $length.
353353
*/
354-
public function slice(int $offset = 0, int $length = null): static
354+
public function slice(int $offset = 0, ?int $length = null): static
355355
{
356356
return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length));
357357
}
@@ -501,7 +501,7 @@ public function ancestors(): static
501501
* @throws \InvalidArgumentException When current node is empty
502502
* @throws \RuntimeException If the CssSelector Component is not available and $selector is provided
503503
*/
504-
public function children(string $selector = null): static
504+
public function children(?string $selector = null): static
505505
{
506506
if (!$this->nodes) {
507507
throw new \InvalidArgumentException('The current node list is empty.');
@@ -559,7 +559,7 @@ public function nodeName(): string
559559
*
560560
* @throws \InvalidArgumentException When current node is empty
561561
*/
562-
public function text(string $default = null, bool $normalizeWhitespace = true): string
562+
public function text(?string $default = null, bool $normalizeWhitespace = true): string
563563
{
564564
if (!$this->nodes) {
565565
if (null !== $default) {
@@ -609,7 +609,7 @@ public function innerText(/* bool $normalizeWhitespace = true */): string
609609
*
610610
* @throws \InvalidArgumentException When current node is empty
611611
*/
612-
public function html(string $default = null): string
612+
public function html(?string $default = null): string
613613
{
614614
if (!$this->nodes) {
615615
if (null !== $default) {
@@ -858,7 +858,7 @@ public function images(): array
858858
*
859859
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
860860
*/
861-
public function form(array $values = null, string $method = null): Form
861+
public function form(?array $values = null, ?string $method = null): Form
862862
{
863863
if (!$this->nodes) {
864864
throw new \InvalidArgumentException('The current node list is empty.');

Form.php

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

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

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