| @@ -43,9 +43,9 @@ | ||
| 43 | 43 | * @param string|null $baseHref The URI of the <base> used for relative links, but not for empty action |
| 44 | 44 | * |
| 45 | 45 | * @throws \LogicException if the node is not a button inside a form tag |
| 46 | 46 | */ |
| 47 | - public function __construct(\DOMElement $node, string $currentUri = null, string $method = null, string $baseHref = null) | |
| 47 | + public function __construct(\DOMElement $node, ?string $currentUri = null, ?string $method = null, ?string $baseHref = null) | |
| 48 | 48 | { |
| 49 | 49 | parent::__construct($node, $currentUri, $method); |
| 50 | 50 | $this->baseHref = $baseHref; |
| 51 | 51 | |
| @@ -202,11 +202,10 @@ | ||
| 202 | 202 | { |
| 203 | 203 | $uri = parent::getUri(); |
| 204 | 204 | |
| 205 | 205 | if (!\in_array($this->getMethod(), ['POST', 'PUT', 'DELETE', 'PATCH'])) { |
| 206 | - $query = parse_url($uri, \PHP_URL_QUERY); | |
| 207 | 206 | $currentParameters = []; |
| 208 | - if ($query) { | |
| 207 | + if ($query = parse_url($uri, \PHP_URL_QUERY)) { | |
| 209 | 208 | parse_str($query, $currentParameters); |
| 210 | 209 | } |
| 211 | 210 | |
| 212 | 211 | $queryString = http_build_query(array_merge($currentParameters, $this->getValues()), '', '&'); |