Skip to content

Commit

Permalink
Merge branch '6.4' into 7.0
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nicolas-grekas committed Jan 23, 2024
2 parents d13205f + 6db3184 commit 3330a8f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion AbstractUriElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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
16 changes: 8 additions & 8 deletions Crawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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 @@ -128,7 +128,7 @@ public function add(\DOMNodeList|\DOMNode|array|string|null $node): void
* or ISO-8859-1 as a fallback, which is the default charset defined by the
* HTTP 1.1 specification.
*/
public function addContent(string $content, string $type = null): void
public function addContent(string $content, ?string $type = null): void
{
if (empty($type)) {
$type = str_starts_with($content, '<?xml') ? 'application/xml' : 'text/html';
Expand Down Expand Up @@ -329,7 +329,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 @@ -479,7 +479,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 All @@ -504,7 +504,7 @@ public function children(string $selector = null): static
*
* @throws \InvalidArgumentException When current node is empty
*/
public function attr(string $attribute, string $default = null): ?string
public function attr(string $attribute, ?string $default = null): ?string
{
if (!$this->nodes) {
if (null !== $default) {
Expand Down Expand Up @@ -543,7 +543,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 @@ -591,7 +591,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 @@ -840,7 +840,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 3330a8f

Please sign in to comment.