diff --git a/library/Graphite/Web/Widget/IcingadbGraphs.php b/library/Graphite/Web/Widget/IcingadbGraphs.php index a96043e..3626a2d 100644 --- a/library/Graphite/Web/Widget/IcingadbGraphs.php +++ b/library/Graphite/Web/Widget/IcingadbGraphs.php @@ -15,7 +15,6 @@ use ipl\Html\HtmlDocument; use ipl\Html\HtmlString; use ipl\Orm\ResultSet; use ipl\Stdlib\BaseFilter; -use ipl\Web\Filter\QueryString; use ipl\Web\Widget\Link; /** @@ -68,11 +67,10 @@ class IcingadbGraphs extends BaseHtmlElement } $hostUrl = Links::host($hostObj); + $baseFilter = $this->getBaseFilter(); - if ($this->hasBaseFilter()) { - $hostUrlParams = $hostUrl->getParams()->toArray(false); - $hostUrl->setQueryString(QueryString::render($this->getBaseFilter())) - ->addParams($hostUrlParams); + if ($baseFilter !== null) { + $hostUrl->setFilter($baseFilter); } $hostLink = new Link( @@ -85,10 +83,8 @@ class IcingadbGraphs extends BaseHtmlElement if ($graph->getObjectType() === 'service') { $serviceUrl = Links::service($object, $hostObj); - if ($this->hasBaseFilter()) { - $serviceUrlParams = $serviceUrl->getParams()->toArray(false); - $serviceUrl->setQueryString(QueryString::render($this->getBaseFilter())) - ->addParams($serviceUrlParams); + if ($baseFilter !== null) { + $serviceUrl->setFilter($baseFilter); } $serviceLink = new Link( diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 7f8a1c4..4e0431e 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -845,11 +845,6 @@ parameters: count: 1 path: library/Graphite/Web/Widget/IcingadbGraphs.php - - - message: "#^Parameter \\#1 \\$rule of static method ipl\\\\Web\\\\Filter\\\\QueryString\\:\\:render\\(\\) expects ipl\\\\Stdlib\\\\Filter\\\\Rule, ipl\\\\Stdlib\\\\Filter\\\\Rule\\|null given\\.$#" - count: 2 - path: library/Graphite/Web/Widget/IcingadbGraphs.php - - message: "#^Property Icinga\\\\Module\\\\Graphite\\\\Web\\\\Widget\\\\IcingadbGraphs\\:\\:\\$defaultAttributes type has no value type specified in iterable type array\\.$#" count: 1