diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..22cbd0e3 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=animeclient +sonar.projectName=Anime Client +sonar.projectVersion=1.0 +sonar.sources=src \ No newline at end of file diff --git a/src/Aviat/AnimeClient/Config.php b/src/Aviat/AnimeClient/Config.php index 2b129750..7f361f1d 100644 --- a/src/Aviat/AnimeClient/Config.php +++ b/src/Aviat/AnimeClient/Config.php @@ -84,8 +84,10 @@ class Config { { $this->map->set($key, $value); } - else throw - new InvalidArgumentException("Key must be integer, string, or array, and cannot be empty"); + else + { + throw new InvalidArgumentException("Key must be integer, string, or array, and cannot be empty"); + } return $this; } diff --git a/src/Aviat/AnimeClient/Dispatcher.php b/src/Aviat/AnimeClient/Dispatcher.php index 777b3383..deb9211c 100644 --- a/src/Aviat/AnimeClient/Dispatcher.php +++ b/src/Aviat/AnimeClient/Dispatcher.php @@ -92,9 +92,7 @@ class Dispatcher extends RoutingBase { 'route_path' => $route_path ]); - $route = $this->router->match($route_path, $_SERVER); - - return $route; + return $this->router->match($route_path, $_SERVER); } /** @@ -230,7 +228,10 @@ class Dispatcher extends RoutingBase { $route_type = $this->get_controller(); // Return early if invalid route array - if ( ! array_key_exists($route_type, $this->routes)) return []; + if ( ! array_key_exists($route_type, $this->routes)) + { + return []; + } $applied_routes = array_merge($this->routes[$route_type], $this->routes['common']); diff --git a/src/Aviat/AnimeClient/Helper/Menu.php b/src/Aviat/AnimeClient/Helper/Menu.php index 9fb6b3a4..01f9199c 100644 --- a/src/Aviat/AnimeClient/Helper/Menu.php +++ b/src/Aviat/AnimeClient/Helper/Menu.php @@ -13,7 +13,7 @@ class Menu { /** * Create the html for the selected menu - * + * * @param string $menu_name * @return string */ diff --git a/src/Aviat/AnimeClient/Model.php b/src/Aviat/AnimeClient/Model.php index 165e979d..877a4add 100644 --- a/src/Aviat/AnimeClient/Model.php +++ b/src/Aviat/AnimeClient/Model.php @@ -56,7 +56,10 @@ class Model { $ext = end($ext_parts); // Workaround for some broken extensions - if ($ext == "jjpg") $ext = "jpg"; + if ($ext == "jjpg") + { + $ext = "jpg"; + } // Failsafe for weird urls if (strlen($ext) > 3) return $api_path;