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 14ff4fd + e412abb commit 6db3184
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion AbstractUriElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class AbstractUriElement
*
* @throws \InvalidArgumentException if the node is not a link
*/
public function __construct(\DOMElement $node, string $currentUri = null, ?string $method = 'GET')
public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = 'GET')
{
$this->setNode($node);
$this->method = $method ? strtoupper($method) : null;
Expand Down
14 changes: 7 additions & 7 deletions Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Crawler implements \Countable, \IteratorAggregate
/**
* @param \DOMNodeList|\DOMNode|\DOMNode[]|string|null $node A Node to use as the base for the crawling
*/
public function __construct(\DOMNodeList|\DOMNode|array|string $node = null, string $uri = null, string $baseHref = null, bool $useHtml5Parser = true)
public function __construct(\DOMNodeList|\DOMNode|array|string|null $node = null, ?string $uri = null, ?string $baseHref = null, bool $useHtml5Parser = true)
{
$this->uri = $uri;
$this->baseHref = $baseHref ?: $uri;
Expand Down Expand Up @@ -137,7 +137,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node)
*
* @return void
*/
public function addContent(string $content, string $type = null)
public function addContent(string $content, ?string $type = null)
{
if (empty($type)) {
$type = str_starts_with($content, '<?xml') ? 'application/xml' : 'text/html';
Expand Down Expand Up @@ -350,7 +350,7 @@ public function each(\Closure $closure): array
/**
* Slices the list of nodes by $offset and $length.
*/
public function slice(int $offset = 0, int $length = null): static
public function slice(int $offset = 0, ?int $length = null): static
{
return $this->createSubCrawler(\array_slice($this->nodes, $offset, $length));
}
Expand Down Expand Up @@ -500,7 +500,7 @@ public function ancestors(): static
* @throws \InvalidArgumentException When current node is empty
* @throws \RuntimeException If the CssSelector Component is not available and $selector is provided
*/
public function children(string $selector = null): static
public function children(?string $selector = null): static
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
Expand Down Expand Up @@ -565,7 +565,7 @@ public function nodeName(): string
*
* @throws \InvalidArgumentException When current node is empty
*/
public function text(string $default = null, bool $normalizeWhitespace = true): string
public function text(?string $default = null, bool $normalizeWhitespace = true): string
{
if (!$this->nodes) {
if (null !== $default) {
Expand Down Expand Up @@ -615,7 +615,7 @@ public function innerText(/* bool $normalizeWhitespace = true */): string
*
* @throws \InvalidArgumentException When current node is empty
*/
public function html(string $default = null): string
public function html(?string $default = null): string
{
if (!$this->nodes) {
if (null !== $default) {
Expand Down Expand Up @@ -864,7 +864,7 @@ public function images(): array
*
* @throws \InvalidArgumentException If the current node list is empty or the selected node is not instance of DOMElement
*/
public function form(array $values = null, string $method = null): Form
public function form(?array $values = null, ?string $method = null): Form
{
if (!$this->nodes) {
throw new \InvalidArgumentException('The current node list is empty.');
Expand Down
2 changes: 1 addition & 1 deletion Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Form extends Link implements \ArrayAccess
*
* @throws \LogicException if the node is not a button inside a form tag
*/
public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null)
public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = null, ?string $baseHref = null)
{
parent::__construct($node, $currentUri, $method);
$this->baseHref = $baseHref;
Expand Down
2 changes: 1 addition & 1 deletion Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
class Image extends AbstractUriElement
{
public function __construct(\DOMElement $node, string $currentUri = null)
public function __construct(\DOMElement $node, ?string $currentUri = null)
{
parent::__construct($node, $currentUri, 'GET');
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AbstractCrawlerTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ abstract class AbstractCrawlerTestCase extends TestCase
{
abstract public static function getDoctype(): string;

protected function createCrawler($node = null, string $uri = null, string $baseHref = null, bool $useHtml5Parser = true)
protected function createCrawler($node = null, ?string $uri = null, ?string $baseHref = null, bool $useHtml5Parser = true)
{
return new Crawler($node, $uri, $baseHref, $useHtml5Parser);
}
Expand Down

0 comments on commit 6db3184

Please sign in to comment.