From 17a335275cf0411435b1f4e061904061baad707d Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Mon, 9 Nov 2015 11:10:15 -0500 Subject: [PATCH] More quality fixes --- src/Aviat/AnimeClient/Model.php | 5 ++++- src/Aviat/AnimeClient/RoutingBase.php | 4 +--- src/Aviat/AnimeClient/UrlGenerator.php | 5 ++++- src/Aviat/Ion/Friend.php | 5 ++++- src/Aviat/Ion/Type/ArrayType.php | 3 +-- 5 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/Aviat/AnimeClient/Model.php b/src/Aviat/AnimeClient/Model.php index 877a4add..e059ff7a 100644 --- a/src/Aviat/AnimeClient/Model.php +++ b/src/Aviat/AnimeClient/Model.php @@ -62,7 +62,10 @@ class Model { } // Failsafe for weird urls - if (strlen($ext) > 3) return $api_path; + if (strlen($ext) > 3) + { + return $api_path; + } $img_cache_path = $this->config->get('img_cache_path'); $cached_image = "{$series_slug}.{$ext}"; diff --git a/src/Aviat/AnimeClient/RoutingBase.php b/src/Aviat/AnimeClient/RoutingBase.php index 0d8aa4ea..9674bb5c 100644 --- a/src/Aviat/AnimeClient/RoutingBase.php +++ b/src/Aviat/AnimeClient/RoutingBase.php @@ -85,9 +85,7 @@ class RoutingBase { public function segments() { $path = $this->path(); - $segments = explode('/', $path); - - return $segments; + return explode('/', $path); } /** diff --git a/src/Aviat/AnimeClient/UrlGenerator.php b/src/Aviat/AnimeClient/UrlGenerator.php index b2e0806d..4bb3225a 100644 --- a/src/Aviat/AnimeClient/UrlGenerator.php +++ b/src/Aviat/AnimeClient/UrlGenerator.php @@ -128,7 +128,10 @@ class UrlGenerator extends RoutingBase { if ($path === '') { $path .= trim($config_default_route, '/'); - if ($this->__get('default_to_list_view')) $path .= '/list'; + if ($this->__get('default_to_list_view')) + { + $path .= '/list'; + } } return $this->url($path); diff --git a/src/Aviat/Ion/Friend.php b/src/Aviat/Ion/Friend.php index 6651910d..4ab44d4f 100644 --- a/src/Aviat/Ion/Friend.php +++ b/src/Aviat/Ion/Friend.php @@ -110,7 +110,10 @@ class Friend { } // Return NULL on any exception, so no further logic needed // in the catch block - catch (\Exception $e) {} + catch (\Exception $e) + { + return NULL; + } return NULL; } diff --git a/src/Aviat/Ion/Type/ArrayType.php b/src/Aviat/Ion/Type/ArrayType.php index 71dadabf..d03ecb2b 100644 --- a/src/Aviat/Ion/Type/ArrayType.php +++ b/src/Aviat/Ion/Type/ArrayType.php @@ -205,8 +205,7 @@ class ArrayType { { if (empty($pos) || ! is_array($pos)) { - $pos = NULL; - return $pos; + return NULL; } $pos =& $pos[$level]; }