From 810c02a41f1a5ebda3b8ebe8b3cbb2189760fd92 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Mon, 4 Dec 2017 10:48:52 +0100 Subject: [PATCH] Url: prefer static over self --- library/Icinga/Web/Url.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php index 8ad89af40..9000c928d 100644 --- a/library/Icinga/Web/Url.php +++ b/library/Icinga/Web/Url.php @@ -105,10 +105,10 @@ class Url public static function fromRequest($params = array(), $request = null) { if ($request === null) { - $request = self::getRequest(); + $request = static::getRequest(); } - $url = new Url(); + $url = new static(); $url->setPath(ltrim($request->getPathInfo(), '/')); // $urlParams = UrlParams::fromQueryString($request->getQuery()); @@ -161,7 +161,7 @@ class Url public static function fromPath($url, array $params = array(), $request = null) { if ($request === null) { - $request = self::getRequest(); + $request = static::getRequest(); } if (! is_string($url)) { @@ -171,7 +171,7 @@ class Url ); } - $urlObject = new Url(); + $urlObject = new static(); if ($url === '#') { $urlObject->setPath($url); @@ -250,7 +250,7 @@ class Url */ public static function urlAddFilterOptional($url, $filter, $optional) { - $url = Url::fromPath($url); + $url = static::fromPath($url); $f = $filter; if (isset($optional)) { $f = Filter::matchAll($filter, $optional); @@ -782,8 +782,8 @@ class Url */ public function matches($url) { - if (! $url instanceof Url) { - $url = Url::fromPath($url); + if (! $url instanceof static) { + $url = static::fromPath($url); } return (string) $url === (string) $this; }