Skip to content

Commit

Permalink
[BUGFIX] PhpStan Variable $parameters in empty() always exists and is…
Browse files Browse the repository at this point in the history
… not falsy

Fixes PhpStan-issue:

```
------ -----------------------------------------------------------------
  Line   Classes/System/Url/UrlHelper.php
 ------ -----------------------------------------------------------------
  52     Variable $parameters in empty() always exists and is not falsy.
 ------ -----------------------------------------------------------------
```

Ports: 1b3218b
  • Loading branch information
dkd-kaehm committed Sep 20, 2024
1 parent f8eeaad commit 2a85965
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Classes/System/Url/UrlHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,7 @@ public function withQueryParameter(string $parameterName, $value): UrlHelper
{
parse_str($this->query, $parameters);
$parameters[$parameterName] = $value;
$query = '';
if (!empty($parameters)) {
$query = http_build_query($parameters);
}
$query = http_build_query($parameters);
$query = $this->sanitizeQuery($query);
$clonedObject = clone $this;
$clonedObject->query = $query;
Expand Down

0 comments on commit 2a85965

Please sign in to comment.