diff options
author | Aurélien Tamisier <virtualtam+github@flibidi.net> | 2018-12-02 22:47:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-02 22:47:41 +0100 |
commit | 1004742f09b55ff781c13745781b9a7e90986faa (patch) | |
tree | aa0e5743390296441edf09f44f95b3d21f2b5a16 /application/Url.php | |
parent | 5e0a898bb13fad528514b0d33763bcaae38b45b0 (diff) | |
parent | 9d9f6d75b94aab51067bdfbe50b58b66d1194f6d (diff) | |
download | Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.gz Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.tar.zst Shaarli-1004742f09b55ff781c13745781b9a7e90986faa.zip |
Merge pull request #1234 from virtualtam/lint
Setup PHPCS and cleanup linter configuration
Diffstat (limited to 'application/Url.php')
-rw-r--r-- | application/Url.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/application/Url.php b/application/Url.php index 6b9870f0..3b7f19c2 100644 --- a/application/Url.php +++ b/application/Url.php | |||
@@ -34,8 +34,8 @@ function unparse_url($parsedUrl) | |||
34 | */ | 34 | */ |
35 | function cleanup_url($url) | 35 | function cleanup_url($url) |
36 | { | 36 | { |
37 | $obj_url = new Url($url); | 37 | $obj_url = new Url($url); |
38 | return $obj_url->cleanup(); | 38 | return $obj_url->cleanup(); |
39 | } | 39 | } |
40 | 40 | ||
41 | /** | 41 | /** |
@@ -47,8 +47,8 @@ function cleanup_url($url) | |||
47 | */ | 47 | */ |
48 | function get_url_scheme($url) | 48 | function get_url_scheme($url) |
49 | { | 49 | { |
50 | $obj_url = new Url($url); | 50 | $obj_url = new Url($url); |
51 | return $obj_url->getScheme(); | 51 | return $obj_url->getScheme(); |
52 | } | 52 | } |
53 | 53 | ||
54 | /** | 54 | /** |
@@ -217,7 +217,7 @@ class Url | |||
217 | } | 217 | } |
218 | 218 | ||
219 | $this->parts['query'] = implode('&', $queryParams); | 219 | $this->parts['query'] = implode('&', $queryParams); |
220 | } | 220 | } |
221 | 221 | ||
222 | /** | 222 | /** |
223 | * Removes undesired fragments | 223 | * Removes undesired fragments |
@@ -269,7 +269,8 @@ class Url | |||
269 | * | 269 | * |
270 | * @return string the URL scheme or false if none is provided. | 270 | * @return string the URL scheme or false if none is provided. |
271 | */ | 271 | */ |
272 | public function getScheme() { | 272 | public function getScheme() |
273 | { | ||
273 | if (!isset($this->parts['scheme'])) { | 274 | if (!isset($this->parts['scheme'])) { |
274 | return false; | 275 | return false; |
275 | } | 276 | } |
@@ -281,7 +282,8 @@ class Url | |||
281 | * | 282 | * |
282 | * @return string the URL host or false if none is provided. | 283 | * @return string the URL host or false if none is provided. |
283 | */ | 284 | */ |
284 | public function getHost() { | 285 | public function getHost() |
286 | { | ||
285 | if (empty($this->parts['host'])) { | 287 | if (empty($this->parts['host'])) { |
286 | return false; | 288 | return false; |
287 | } | 289 | } |
@@ -293,7 +295,8 @@ class Url | |||
293 | * | 295 | * |
294 | * @return true is HTTP, false otherwise. | 296 | * @return true is HTTP, false otherwise. |
295 | */ | 297 | */ |
296 | public function isHttp() { | 298 | public function isHttp() |
299 | { | ||
297 | return strpos(strtolower($this->parts['scheme']), 'http') !== false; | 300 | return strpos(strtolower($this->parts['scheme']), 'http') !== false; |
298 | } | 301 | } |
299 | } | 302 | } |