Skip to content

Commit 38e9b4a

Browse files
author
Robin Chalas
committed
[DomCrawler] Fix type error with null Form::$currentUri
1 parent f76de9f commit 38e9b4a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Form.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Form extends Link implements \ArrayAccess
4444
*
4545
* @throws \LogicException if the node is not a button inside a form tag
4646
*/
47-
public function __construct(\DOMElement $node, string $currentUri, string $method = null, string $baseHref = null)
47+
public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null)
4848
{
4949
parent::__construct($node, $currentUri, $method);
5050
$this->baseHref = $baseHref;

Tests/CrawlerTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ public function getBaseTagWithFormData()
10911091
['/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', '<base> tag does work with a path and form action'],
10921092
['/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', '<base> tag does work with a path and empty form action'],
10931093
['http://base.com/', '/registration', 'http://base.com/registration', 'http://domain.com/registration', '<base> tag does work with a URL and form action'],
1094+
['http://base.com/', 'http://base.com/registration', 'http://base.com/registration', null, '<base> tag does work with a URL and form action'],
10941095
['http://base.com', '', 'http://domain.com/path/form', 'http://domain.com/path/form', '<base> tag does work with a URL and an empty form action'],
10951096
['http://base.com/path', '/registration', 'http://base.com/registration', 'http://domain.com/path/form', '<base> tag does work with a URL and form action'],
10961097
];

0 commit comments

Comments
 (0)