Skip to content

Commit 6db3184

Browse files
Merge branch '6.3' into 6.4
* 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
2 parents 14ff4fd + e412abb commit 6db3184

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
@@ -63,7 +63,7 @@ class Crawler implements \Countable, \IteratorAggregate
6363
/**
6464
* @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling
6565
*/
66-
public function __construct(\DOMNodeList|\DOMNode|array|string $node = null, string $uri = null, string $baseHref = null, bool $useHtml5Parser = true)
66+
public function __construct(\DOMNodeList|\DOMNode|array|string|null $node = null, ?string $uri = null, ?string $baseHref = null, bool $useHtml5Parser = true)
6767
{
6868
$this->uri = $uri;
6969
$this->baseHref = $baseHref ?: $uri;
@@ -137,7 +137,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node)
137137
*
138138
* @return void
139139
*/
140-
public function addContent(string $content, string $type = null)
140+
public function addContent(string $content, ?string $type = null)
141141
{
142142
if (empty($type)) {
143143
$type = str_starts_with($content, '<?xml') ? 'application/xml' : 'text/html';
@@ -350,7 +350,7 @@ public function each(\Closure $closure): array
350350
/**
351351
* Slices the list of nodes by $offset and $length.
352352
*/
353-
public function slice(int $offset = 0, int $length = null): static
353+
public function slice(int $offset = 0, ?int $length = null): static
354354
{
355355
return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length));
356356
}
@@ -500,7 +500,7 @@ public function ancestors(): static
500500
* @throws \InvalidArgumentException When current node is empty
501501
* @throws \RuntimeException If the CssSelector Component is not available and $selector is provided
502502
*/
503-
public function children(string $selector = null): static
503+
public function children(?string $selector = null): static
504504
{
505505
if (!$this->nodes) {
506506
throw new \InvalidArgumentException('The current node list is empty.');
@@ -565,7 +565,7 @@ public function nodeName(): string
565565
*
566566
* @throws \InvalidArgumentException When current node is empty
567567
*/
568-
public function text(string $default = null, bool $normalizeWhitespace = true): string
568+
public function text(?string $default = null, bool $normalizeWhitespace = true): string
569569
{
570570
if (!$this->nodes) {
571571
if (null !== $default) {
@@ -615,7 +615,7 @@ public function innerText(/* bool $normalizeWhitespace = true */): string
615615
*
616616
* @throws \InvalidArgumentException When current node is empty
617617
*/
618-
public function html(string $default = null): string
618+
public function html(?string $default = null): string
619619
{
620620
if (!$this->nodes) {
621621
if (null !== $default) {
@@ -864,7 +864,7 @@ public function images(): array
864864
*
865865
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
866866
*/
867-
public function form(array $values = null, string $method = null): Form
867+
public function form(?array $values = null, ?string $method = null): Form
868868
{
869869
if (!$this->nodes) {
870870
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)