Skip to content

Commit

Permalink
bug #31757 [DomCrawler] Fix type error with null Form::$currentUri (c…
Browse files Browse the repository at this point in the history
…halasr)

This PR was merged into the 4.2 branch.

Discussion
----------

[DomCrawler] Fix type error with null Form::$currentUri

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31644
| License       | MIT
| Doc PR        | n/a

Commits
-------

e48d5d0 [DomCrawler] Fix type error with null Form::$currentUri
  • Loading branch information
nicolas-grekas committed May 31, 2019
2 parents 06c6552 + e48d5d0 commit da01afa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Symfony/Component/DomCrawler/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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, 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
1 change: 1 addition & 0 deletions src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1091,6 +1091,7 @@ public function getBaseTagWithFormData()
['/basepath', '/registration', 'http://domain.com/registration', 'http://domain.com/registration', '<base> tag does work with a path and form action'],
['/basepath', '', 'http://domain.com/registration', 'http://domain.com/registration', '<base> tag does work with a path and empty form action'],
['http://base.com/', '/registration', 'http://base.com/registration', 'http://domain.com/registration', '<base> tag does work with a URL and form action'],
['http://base.com/', 'http://base.com/registration', 'http://base.com/registration', null, '<base> tag does work with a URL and form action'],
['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'],
['http://base.com/path', '/registration', 'http://base.com/registration', 'http://domain.com/path/form', '<base> tag does work with a URL and form action'],
];
Expand Down

0 comments on commit da01afa

Please sign in to comment.