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.
 ------ -----------------------------------------------------------------
```
  • Loading branch information
dkd-kaehm committed Sep 19, 2024
1 parent fe7c9eb commit 1b3218b
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 1b3218b

Please sign in to comment.