From 7c5a73e73bd77cbe322e477b3bf7ca23eb563484 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Tue, 6 Oct 2015 14:24:48 +0000 Subject: [PATCH] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- app/bootstrap.php | 2 +- index.php | 2 +- src/Aviat/AnimeClient/Config.php | 2 +- src/Aviat/AnimeClient/Controller.php | 14 +++++------ src/Aviat/AnimeClient/Controller/Anime.php | 6 ++--- .../AnimeClient/Controller/Collection.php | 6 ++--- src/Aviat/AnimeClient/Controller/Manga.php | 6 ++--- src/Aviat/AnimeClient/MenuGenerator.php | 6 ++--- src/Aviat/AnimeClient/Model.php | 6 ++--- src/Aviat/AnimeClient/Model/API.php | 2 +- src/Aviat/AnimeClient/Model/Anime.php | 12 +++++----- .../AnimeClient/Model/AnimeCollection.php | 24 +++++++++---------- src/Aviat/AnimeClient/Model/DB.php | 2 +- src/Aviat/AnimeClient/Model/Manga.php | 8 +++---- src/Aviat/AnimeClient/Router.php | 2 +- src/Aviat/AnimeClient/RoutingBase.php | 2 +- .../Hummingbird/MangaListsZipper.php | 4 ++-- src/Aviat/AnimeClient/UrlGenerator.php | 4 ++-- src/Aviat/Ion/Di/Container.php | 2 +- src/Aviat/Ion/Friend.php | 2 +- .../Ion/Transformer/AbstractTransformer.php | 2 +- src/Aviat/Ion/Type/ArrayType.php | 2 +- 22 files changed, 59 insertions(+), 59 deletions(-) diff --git a/app/bootstrap.php b/app/bootstrap.php index ccca2cf8..dfbc39ce 100644 --- a/app/bootstrap.php +++ b/app/bootstrap.php @@ -33,7 +33,7 @@ $di = function() { // Set up json handler for ajax errors $jsonHandler = new JsonResponseHandler(); - $jsonHandler->onlyForAjaxRequests(true); + $jsonHandler->onlyForAjaxRequests(TRUE); $whoops->pushHandler($jsonHandler); $whoops->register(); diff --git a/index.php b/index.php index ab0b6dd0..a862b945 100644 --- a/index.php +++ b/index.php @@ -35,7 +35,7 @@ function _dir() * @codeCoverageIgnore * @return void */ -spl_autoload_register(function ($class) { +spl_autoload_register(function($class) { $class_parts = explode('\\', $class); $ns_path = SRC_DIR . '/' . implode('/', $class_parts) . ".php"; diff --git a/src/Aviat/AnimeClient/Config.php b/src/Aviat/AnimeClient/Config.php index d50ac388..90d45bc4 100644 --- a/src/Aviat/AnimeClient/Config.php +++ b/src/Aviat/AnimeClient/Config.php @@ -22,7 +22,7 @@ class Config { * * @param array $config_files */ - public function __construct(Array $config_files=[]) + public function __construct(array $config_files=[]) { // @codeCoverageIgnoreStart if (empty($config_files)) diff --git a/src/Aviat/AnimeClient/Controller.php b/src/Aviat/AnimeClient/Controller.php index 74eb652d..c7e16488 100644 --- a/src/Aviat/AnimeClient/Controller.php +++ b/src/Aviat/AnimeClient/Controller.php @@ -53,7 +53,7 @@ class Controller { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { @@ -92,7 +92,7 @@ class Controller { * @param array|object $data * @return string */ - public function load_partial($view, $template, $data=[]) + public function load_partial($view, $template, $data = []) { $errorHandler = $this->container->get('error-handler'); $errorHandler->addDataTable('Template Data', $data); @@ -120,7 +120,7 @@ class Controller { /** * Render a template with header and footer * - * @param HTMLView $view + * @param HtmlView $view * @param string $template * @param array|object $data * @return void @@ -139,7 +139,7 @@ class Controller { * @param array|object $data * @return void */ - public function outputHTML($template, $data=[]) + public function outputHTML($template, $data = []) { $view = new HtmlView($this->container); $this->render_full_page($view, $template, $data); @@ -151,7 +151,7 @@ class Controller { * @param mixed $data * @return void */ - public function outputJSON($data=[]) + public function outputJSON($data = []) { $view = new JsonView($this->container); $view->setOutput($data); @@ -165,7 +165,7 @@ class Controller { * @param string $type * @return void */ - public function redirect($path, $code, $type="anime") + public function redirect($path, $code, $type = "anime") { $url = $this->urlGenerator->full_url($path, $type); $http = new HttpView($this->container); @@ -205,7 +205,7 @@ class Controller { * @param string $status * @return void */ - public function login($status="") + public function login($status = "") { $message = ""; diff --git a/src/Aviat/AnimeClient/Controller/Anime.php b/src/Aviat/AnimeClient/Controller/Anime.php index 7001d9ee..ddce052a 100644 --- a/src/Aviat/AnimeClient/Controller/Anime.php +++ b/src/Aviat/AnimeClient/Controller/Anime.php @@ -51,7 +51,7 @@ class Anime extends BaseController { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { @@ -73,7 +73,7 @@ class Anime extends BaseController { ]); } - public function index($type="watching", $view='') + public function index($type = "watching", $view = '') { return $this->anime_list($type, $view); } @@ -136,7 +136,7 @@ class Anime extends BaseController { /** * Update an anime item * - * @return bool + * @return boolean|null */ public function update() { diff --git a/src/Aviat/AnimeClient/Controller/Collection.php b/src/Aviat/AnimeClient/Controller/Collection.php index 17e2739f..0a57d0d9 100644 --- a/src/Aviat/AnimeClient/Controller/Collection.php +++ b/src/Aviat/AnimeClient/Controller/Collection.php @@ -52,7 +52,7 @@ class Collection extends BaseController { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { @@ -113,11 +113,11 @@ class Collection extends BaseController { * @param int $id * @return void */ - public function form($id=NULL) + public function form($id = NULL) { $action = (is_null($id)) ? "Add" : "Edit"; - $this->outputHTML('collection/'. strtolower($action), [ + $this->outputHTML('collection/' . strtolower($action), [ 'action' => $action, 'action_url' => $this->urlGenerator->full_url("collection/" . strtolower($action)), 'title' => $this->config->whose_list . " Anime Collection · {$action}", diff --git a/src/Aviat/AnimeClient/Controller/Manga.php b/src/Aviat/AnimeClient/Controller/Manga.php index 74d06207..458de1ed 100644 --- a/src/Aviat/AnimeClient/Controller/Manga.php +++ b/src/Aviat/AnimeClient/Controller/Manga.php @@ -43,7 +43,7 @@ class Manga extends Controller { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { @@ -58,7 +58,7 @@ class Manga extends Controller { ]); } - public function index($status="all", $view="") + public function index($status = "all", $view = "") { return $this->manga_list($status, $view); } @@ -66,7 +66,7 @@ class Manga extends Controller { /** * Update an anime item * - * @return bool + * @return boolean|null */ public function update() { diff --git a/src/Aviat/AnimeClient/MenuGenerator.php b/src/Aviat/AnimeClient/MenuGenerator.php index e4dfdc38..a062afec 100644 --- a/src/Aviat/AnimeClient/MenuGenerator.php +++ b/src/Aviat/AnimeClient/MenuGenerator.php @@ -63,10 +63,10 @@ class MenuGenerator extends RoutingBase { $parsed = []; - foreach($this->menus as $name => $menu) + foreach ($this->menus as $name => $menu) { $parsed[$name] = []; - foreach($menu['items'] as $path_name => $partial_path) + foreach ($menu['items'] as $path_name => $partial_path) { $title = $this->string($path_name)->humanize()->titleize(); $parsed[$name]['items'][$title] = $this->string($menu['route_prefix'])->append($partial_path); @@ -90,7 +90,7 @@ class MenuGenerator extends RoutingBase { */ public function generate($menu) { - $parsed_config = $this->parse_config(); + $parsed_config = $this->parse_config(); $menu_config = $parsed_config[$menu]; // Array of list items to add to the main menu diff --git a/src/Aviat/AnimeClient/Model.php b/src/Aviat/AnimeClient/Model.php index 95b8305a..087eb04b 100644 --- a/src/Aviat/AnimeClient/Model.php +++ b/src/Aviat/AnimeClient/Model.php @@ -29,7 +29,7 @@ class Model { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { @@ -47,7 +47,7 @@ class Model { * @param string $type - Anime or Manga, controls cache path * @return string - the frontend path for the cached image */ - public function get_cached_image($api_path, $series_slug, $type="anime") + public function get_cached_image($api_path, $series_slug, $type = "anime") { $api_path = str_replace("jjpg", "jpg", $api_path); $path_parts = explode('?', basename($api_path)); @@ -111,7 +111,7 @@ class Model { private function _resize($path, $width, $height) { $img = new SimpleImage($path); - $img->resize($width,$height)->save(); + $img->resize($width, $height)->save(); } } // End of BaseModel.php \ No newline at end of file diff --git a/src/Aviat/AnimeClient/Model/API.php b/src/Aviat/AnimeClient/Model/API.php index eee0919f..127d69b5 100644 --- a/src/Aviat/AnimeClient/Model/API.php +++ b/src/Aviat/AnimeClient/Model/API.php @@ -37,7 +37,7 @@ class API extends BaseModel { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { diff --git a/src/Aviat/AnimeClient/Model/Anime.php b/src/Aviat/AnimeClient/Model/Anime.php index 4cc2dff7..05cbd53a 100644 --- a/src/Aviat/AnimeClient/Model/Anime.php +++ b/src/Aviat/AnimeClient/Model/Anime.php @@ -73,13 +73,13 @@ class Anime extends API { $data = $this->_get_list_from_api(); - foreach($data as $datum) + foreach ($data as $datum) { $output[$this->const_map[$datum['watching_status']]][] = $datum; } // Sort anime by name - foreach($output as &$status_list) + foreach ($output as &$status_list) { $this->sort_by_name($status_list); } @@ -157,7 +157,7 @@ class Anime extends API { * @param string $status * @return array */ - protected function _get_list_from_api($status="all") + protected function _get_list_from_api($status = "all") { $config = [ 'allow_redirects' => FALSE @@ -171,7 +171,7 @@ class Anime extends API { $response = $this->client->get("users/{$this->config->hummingbird_username}/library", $config); $output = $this->_check_cache($status, $response); - foreach($output as &$row) + foreach ($output as &$row) { $row['anime']['image'] = $this->get_cached_image($row['anime']['image'], $row['anime']['slug'], 'anime'); } @@ -197,7 +197,7 @@ class Anime extends API { if ($api_data === $cached && file_exists($transformed_cache_file)) { - return json_decode(file_get_contents($transformed_cache_file),TRUE); + return json_decode(file_get_contents($transformed_cache_file), TRUE); } else { @@ -219,7 +219,7 @@ class Anime extends API { { $sort = array(); - foreach($array as $key => $item) + foreach ($array as $key => $item) { $sort[$key] = $item['anime']['title']; } diff --git a/src/Aviat/AnimeClient/Model/AnimeCollection.php b/src/Aviat/AnimeClient/Model/AnimeCollection.php index c966db47..35fae500 100644 --- a/src/Aviat/AnimeClient/Model/AnimeCollection.php +++ b/src/Aviat/AnimeClient/Model/AnimeCollection.php @@ -29,7 +29,7 @@ class AnimeCollection extends DB { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { @@ -61,7 +61,7 @@ class AnimeCollection extends DB { * @param array $filter * @return array */ - public function get_genre_list($filter=[]) + public function get_genre_list($filter = []) { $this->db->select('hummingbird_id, genre') ->from('genre_anime_set_link gl') @@ -76,7 +76,7 @@ class AnimeCollection extends DB { $output = []; - foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $row) + foreach ($query->fetchAll(\PDO::FETCH_ASSOC) as $row) { $id = $row['hummingbird_id']; $genre = $row['genre']; @@ -109,7 +109,7 @@ class AnimeCollection extends DB { $collection = []; - foreach($raw_collection as $row) + foreach ($raw_collection as $row) { if (array_key_exists($row['media'], $collection)) { @@ -137,7 +137,7 @@ class AnimeCollection extends DB { ->from('media') ->get(); - foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $row) + foreach ($query->fetchAll(\PDO::FETCH_ASSOC) as $row) { $output[$row['id']] = $row['type']; } @@ -154,7 +154,7 @@ class AnimeCollection extends DB { public function get_collection_entry($id) { $query = $this->db->from('anime_set') - ->where('hummingbird_id', (int) $id) + ->where('hummingbird_id', (int)$id) ->get(); return $query->fetch(\PDO::FETCH_ASSOC); @@ -187,7 +187,7 @@ class AnimeCollection extends DB { */ public function add($data) { - $anime = (object) $this->anime_model->get_anime($data['id']); + $anime = (object)$this->anime_model->get_anime($data['id']); $this->db->set([ 'hummingbird_id' => $data['id'], @@ -252,7 +252,7 @@ class AnimeCollection extends DB { $anime = json_decode(file_get_contents("import.json")); - foreach($anime as $item) + foreach ($anime as $item) { $this->db->set([ 'hummingbird_id' => $item->id, @@ -287,7 +287,7 @@ class AnimeCollection extends DB { // Get api information $anime = $this->anime_model->get_anime($anime_id); - foreach($anime['genres'] as $genre) + foreach ($anime['genres'] as $genre) { // Add genres that don't currently exist if ( ! in_array($genre['name'], $genres)) @@ -335,7 +335,7 @@ class AnimeCollection extends DB { $query = $this->db->select('id, genre') ->from('genres') ->get(); - foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $genre) + foreach ($query->fetchAll(\PDO::FETCH_ASSOC) as $genre) { $genres[$genre['id']] = $genre['genre']; } @@ -344,7 +344,7 @@ class AnimeCollection extends DB { $query = $this->db->select('hummingbird_id, genre_id') ->from('genre_anime_set_link') ->get(); - foreach($query->fetchAll(\PDO::FETCH_ASSOC) as $link) + foreach ($query->fetchAll(\PDO::FETCH_ASSOC) as $link) { if (array_key_exists($link['hummingbird_id'], $links)) { @@ -371,7 +371,7 @@ class AnimeCollection extends DB { { // Get the anime collection $collection = $this->_get_collection(); - foreach($collection as $anime) + foreach ($collection as $anime) { // Get api information $this->update_genre($anime['hummingbird_id']); diff --git a/src/Aviat/AnimeClient/Model/DB.php b/src/Aviat/AnimeClient/Model/DB.php index 33564c21..365ebbd2 100644 --- a/src/Aviat/AnimeClient/Model/DB.php +++ b/src/Aviat/AnimeClient/Model/DB.php @@ -26,7 +26,7 @@ class DB extends BaseModel { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { diff --git a/src/Aviat/AnimeClient/Model/Manga.php b/src/Aviat/AnimeClient/Model/Manga.php index 3ce4f256..cfab0783 100644 --- a/src/Aviat/AnimeClient/Model/Manga.php +++ b/src/Aviat/AnimeClient/Model/Manga.php @@ -65,7 +65,7 @@ class Manga extends API { { $data = $this->_get_list_from_api(); - foreach($data as $key => &$val) + foreach ($data as $key => &$val) { $this->sort_by_name($val); } @@ -87,7 +87,7 @@ class Manga extends API { return $data; } - private function _get_list_from_api($status="All") + private function _get_list_from_api($status = "All") { $config = [ @@ -154,7 +154,7 @@ class Manga extends API { self::COMPLETED => [], ]; - foreach($data as &$entry) + foreach ($data as &$entry) { $entry['manga']['image'] = $this->get_cached_image($entry['manga']['image'], $entry['manga']['slug'], 'manga'); $key = $this->const_map[$entry['reading_status']]; @@ -185,7 +185,7 @@ class Manga extends API { { $sort = array(); - foreach($array as $key => $item) + foreach ($array as $key => $item) { $sort[$key] = $item['manga']['title']; } diff --git a/src/Aviat/AnimeClient/Router.php b/src/Aviat/AnimeClient/Router.php index cae41ebb..9b3fd21f 100644 --- a/src/Aviat/AnimeClient/Router.php +++ b/src/Aviat/AnimeClient/Router.php @@ -35,7 +35,7 @@ class Router extends RoutingBase { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { diff --git a/src/Aviat/AnimeClient/RoutingBase.php b/src/Aviat/AnimeClient/RoutingBase.php index c4eda02b..ac098e8b 100644 --- a/src/Aviat/AnimeClient/RoutingBase.php +++ b/src/Aviat/AnimeClient/RoutingBase.php @@ -32,7 +32,7 @@ class RoutingBase { /** * Constructor * - * @param Container $container + * @param ContainerInterface $container */ public function __construct(ContainerInterface $container) { diff --git a/src/Aviat/AnimeClient/Transformer/Hummingbird/MangaListsZipper.php b/src/Aviat/AnimeClient/Transformer/Hummingbird/MangaListsZipper.php index 004de081..91d14992 100644 --- a/src/Aviat/AnimeClient/Transformer/Hummingbird/MangaListsZipper.php +++ b/src/Aviat/AnimeClient/Transformer/Hummingbird/MangaListsZipper.php @@ -43,7 +43,7 @@ class MangaListsZipper { $output = []; - foreach($this->manga_tracking_list as &$entry) + foreach ($this->manga_tracking_list as &$entry) { $id = $entry['manga_id']; $entry['manga'] = $this->manga_series_list[$id]; @@ -65,7 +65,7 @@ class MangaListsZipper { $orig_list = $this->manga_series_list; $indexed_list = []; - foreach($orig_list as $manga) + foreach ($orig_list as $manga) { $id = $manga['id']; $indexed_list[$id] = $manga; diff --git a/src/Aviat/AnimeClient/UrlGenerator.php b/src/Aviat/AnimeClient/UrlGenerator.php index ac27724d..4b4c4b4d 100644 --- a/src/Aviat/AnimeClient/UrlGenerator.php +++ b/src/Aviat/AnimeClient/UrlGenerator.php @@ -32,7 +32,7 @@ class UrlGenerator extends RoutingBase { * @param string $type - (optional) The controller * @return string */ - public function base_url($type="anime") + public function base_url($type = "anime") { $config_path = trim($this->__get("{$type}_path"), "/"); @@ -88,7 +88,7 @@ class UrlGenerator extends RoutingBase { * @param string $type - (optional) The controller (anime or manga), defaults to anime * @return string */ - public function full_url($path="", $type="anime") + public function full_url($path = "", $type = "anime") { $config_path = trim($this->__get("{$type}_path"), "/"); $config_default_route = $this->__get("default_{$type}_path"); diff --git a/src/Aviat/Ion/Di/Container.php b/src/Aviat/Ion/Di/Container.php index b80716cd..b5bea086 100644 --- a/src/Aviat/Ion/Di/Container.php +++ b/src/Aviat/Ion/Di/Container.php @@ -23,7 +23,7 @@ class Container implements ContainerInterface { */ public function __construct(array $values = []) { - $this->container = new ArrayObject($values); + $this->container = new ArrayObject($values); } /** diff --git a/src/Aviat/Ion/Friend.php b/src/Aviat/Ion/Friend.php index 87004b8d..20c49274 100644 --- a/src/Aviat/Ion/Friend.php +++ b/src/Aviat/Ion/Friend.php @@ -99,7 +99,7 @@ class Friend { $property->setAccessible(TRUE); return $property; } - catch(\Exception $e) {} + catch (\Exception $e) {} return NULL; } diff --git a/src/Aviat/Ion/Transformer/AbstractTransformer.php b/src/Aviat/Ion/Transformer/AbstractTransformer.php index 076dc514..d3972998 100644 --- a/src/Aviat/Ion/Transformer/AbstractTransformer.php +++ b/src/Aviat/Ion/Transformer/AbstractTransformer.php @@ -22,7 +22,7 @@ abstract class AbstractTransformer implements TransformerInterface { */ public function transform_collection($collection) { - $list = (array) $collection; + $list = (array)$collection; return array_map([$this, 'transform'], $list); } } diff --git a/src/Aviat/Ion/Type/ArrayType.php b/src/Aviat/Ion/Type/ArrayType.php index 190e8053..40f928b2 100644 --- a/src/Aviat/Ion/Type/ArrayType.php +++ b/src/Aviat/Ion/Type/ArrayType.php @@ -59,7 +59,7 @@ class ArrayType { * * @param array $arr */ - public function __construct(Array $arr) + public function __construct(array $arr) { $this->arr =& $arr; }