@@ -48,7 +48,7 @@ |
||
| 48 | 48 | /** |
| 49 | 49 | * Constructor |
| 50 | 50 | * |
| 51 | - * @param ContainerInterface $container |
|
| 51 | + * @param \Aviat\Ion\Di\ContainerInterface $container |
|
| 52 | 52 | */ |
| 53 | 53 | public function __construct(ContainerInterface $container) |
| 54 | 54 | { |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * This is a dirty hack until I can fully track down where |
| 51 | 51 | * the dual-encoding happens |
| 52 | 52 | * |
| 53 | - * @param FormBody $formBody The form builder object to fix |
|
| 53 | + * @param \Amp\Artax\FormBody $formBody The form builder object to fix |
|
| 54 | 54 | * @return string |
| 55 | 55 | */ |
| 56 | 56 | private function fixBody(FormBody $formBody): string |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | /** |
| 158 | 158 | * Remove some boilerplate for get requests |
| 159 | 159 | * |
| 160 | - * @param array $args |
|
| 160 | + * @param string $args |
|
| 161 | 161 | * @return array |
| 162 | 162 | */ |
| 163 | 163 | protected function getRequest(...$args): array |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | private function getResponse(string $type, string $url, array $options = []) |
| 144 | 144 | { |
| 145 | - $logger = null; |
|
| 145 | + $logger = NULL; |
|
| 146 | 146 | if ($this->getContainer()) |
| 147 | 147 | { |
| 148 | 148 | $logger = $this->container->getLogger('mal-request'); |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | */ |
| 176 | 176 | private function request(string $type, string $url, array $options = []): array |
| 177 | 177 | { |
| 178 | - $logger = null; |
|
| 178 | + $logger = NULL; |
|
| 179 | 179 | if ($this->getContainer()) |
| 180 | 180 | { |
| 181 | 181 | $logger = $this->container->getLogger('mal-request'); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | protected function postRequest(...$args): array |
| 215 | 215 | { |
| 216 | - $logger = null; |
|
| 216 | + $logger = NULL; |
|
| 217 | 217 | if ($this->getContainer()) |
| 218 | 218 | { |
| 219 | 219 | $logger = $this->container->getLogger('mal-request'); |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | $request = $this->requestBuilder |
| 95 | 95 | ->newRequest($type, $url) |
| 96 | - ->setBasicAuth($config->get(['mal','username']), $config->get(['mal','password'])); |
|
| 96 | + ->setBasicAuth($config->get(['mal', 'username']), $config->get(['mal', 'password'])); |
|
| 97 | 97 | |
| 98 | 98 | if (array_key_exists('query', $options)) |
| 99 | 99 | { |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | |
| 157 | 157 | $response = $this->getResponse($type, $url, $options); |
| 158 | 158 | |
| 159 | - if ((int) $response->getStatus() > 299 || (int) $response->getStatus() < 200) |
|
| 159 | + if ((int)$response->getStatus() > 299 || (int)$response->getStatus() < 200) |
|
| 160 | 160 | { |
| 161 | 161 | if ($logger) |
| 162 | 162 | { |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - return XML::toArray((string) $response->getBody()); |
|
| 167 | + return XML::toArray((string)$response->getBody()); |
|
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $response = $this->getResponse('POST', ...$args); |
| 196 | 196 | $validResponseCodes = [200, 201]; |
| 197 | 197 | |
| 198 | - if ( ! in_array((int) $response->getStatus(), $validResponseCodes)) |
|
| 198 | + if ( ! in_array((int)$response->getStatus(), $validResponseCodes)) |
|
| 199 | 199 | { |
| 200 | 200 | if ($logger) |
| 201 | 201 | { |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | * Recursively create array structure based on xml structure |
| 176 | 176 | * |
| 177 | 177 | * @param array &$root A reference to the current array location |
| 178 | - * @param DOMNodeList $nodeList The current NodeList object |
|
| 178 | + * @param \DOMNodeList $nodeList The current NodeList object |
|
| 179 | 179 | * @return void |
| 180 | 180 | */ |
| 181 | 181 | private static function childNodesToArray(array &$root, DOMNodelist $nodeList) |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | for ($i = 0; $i < $length; $i++) |
| 185 | 185 | { |
| 186 | 186 | $el = $nodeList->item($i); |
| 187 | - $current =& $root[$el->nodeName]; |
|
| 187 | + $current = & $root[$el->nodeName]; |
|
| 188 | 188 | |
| 189 | 189 | // It's a top level element! |
| 190 | 190 | if (is_a($el->childNodes->item(0), 'DomText') || ( ! $el->hasChildNodes())) |
@@ -232,14 +232,14 @@ discard block |
||
| 232 | 232 | * @param array $data The data for the current node |
| 233 | 233 | * @return void |
| 234 | 234 | */ |
| 235 | - private static function arrayPropertiesToXmlNodes(DOMDocument &$dom, DOMNode &$parent, array $data) |
|
| 235 | + private static function arrayPropertiesToXmlNodes(DOMDocument & $dom, DOMNode & $parent, array $data) |
|
| 236 | 236 | { |
| 237 | - foreach($data as $key => $props) |
|
| 237 | + foreach ($data as $key => $props) |
|
| 238 | 238 | { |
| 239 | 239 | // 'Flatten' the array as you create the xml |
| 240 | 240 | if (is_numeric($key)) |
| 241 | 241 | { |
| 242 | - foreach($props as $key => $props) |
|
| 242 | + foreach ($props as $key => $props) |
|
| 243 | 243 | { |
| 244 | 244 | break; |
| 245 | 245 | } |
@@ -64,7 +64,7 @@ |
||
| 64 | 64 | /** |
| 65 | 65 | * Setup the Di container |
| 66 | 66 | * |
| 67 | - * @return Container |
|
| 67 | + * @return \Aviat\Ion\Di\ContainerInterface |
|
| 68 | 68 | */ |
| 69 | 69 | protected function setupContainer() |
| 70 | 70 | { |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $config = loadToml($CONF_DIR); |
| 74 | 74 | $config_array = array_merge($base_config, $config); |
| 75 | 75 | |
| 76 | - $di = function ($config_array) use ($APP_DIR) { |
|
| 76 | + $di = function($config_array) use ($APP_DIR) { |
|
| 77 | 77 | $container = new Container(); |
| 78 | 78 | |
| 79 | 79 | // ------------------------------------------------------------------------- |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | /** |
| 51 | 51 | * Set up the Util class |
| 52 | 52 | * |
| 53 | - * @param ContainerInterface $container |
|
| 53 | + * @param \Aviat\Ion\Di\ContainerInterface $container |
|
| 54 | 54 | */ |
| 55 | 55 | public function __construct(ContainerInterface $container) |
| 56 | 56 | { |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Hummingbird Anime Client |
| 4 | 4 | * |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | { |
| 92 | 92 | $url = $this->container->get('request') |
| 93 | 93 | ->getUri(); |
| 94 | - $page_segments = explode("/", (string) $url); |
|
| 94 | + $page_segments = explode("/", (string)$url); |
|
| 95 | 95 | |
| 96 | 96 | $intersect = array_intersect($page_segments, self::$form_pages); |
| 97 | 97 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -23,8 +23,7 @@ discard block |
||
| 23 | 23 | /** |
| 24 | 24 | * Model for handling requests dealing with the manga list |
| 25 | 25 | */ |
| 26 | -class Manga extends API |
|
| 27 | -{ |
|
| 26 | +class Manga extends API { |
|
| 28 | 27 | |
| 29 | 28 | const READING = 'Reading'; |
| 30 | 29 | const PLAN_TO_READ = 'Plan to Read'; |
@@ -160,12 +159,14 @@ discard block |
||
| 160 | 159 | self::COMPLETED => [], |
| 161 | 160 | ]; |
| 162 | 161 | |
| 163 | - foreach ($data as &$entry) { |
|
| 162 | + foreach ($data as &$entry) |
|
| 163 | + { |
|
| 164 | 164 | $key = $this->status_map[$entry['reading_status']]; |
| 165 | 165 | $output[$key][] = $entry; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | - foreach ($output as &$val) { |
|
| 168 | + foreach ($output as &$val) |
|
| 169 | + { |
|
| 169 | 170 | $this->sortByName($val, 'manga'); |
| 170 | 171 | } |
| 171 | 172 | |
@@ -53,7 +53,8 @@ |
||
| 53 | 53 | * Anime constructor. |
| 54 | 54 | * @param ContainerInterface $container |
| 55 | 55 | */ |
| 56 | - public function __construct(ContainerInterface $container) { |
|
| 56 | + public function __construct(ContainerInterface $container) |
|
| 57 | + { |
|
| 57 | 58 | parent::__construct($container); |
| 58 | 59 | |
| 59 | 60 | $config = $container->get('config'); |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -194,7 +194,7 @@ |
||
| 194 | 194 | * @param string|null $malId |
| 195 | 195 | * @return bool |
| 196 | 196 | */ |
| 197 | - public function deleteLibraryItem(string $id, string $malId = null): bool |
|
| 197 | + public function deleteLibraryItem(string $id, string $malId = NULL): bool |
|
| 198 | 198 | { |
| 199 | 199 | $requests = []; |
| 200 | 200 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Hummingbird Anime Client |
| 4 | 4 | * |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $this->setContainer($container); |
| 92 | 92 | $auraUrlGenerator = $container->get('aura-router')->getGenerator(); |
| 93 | 93 | $urlGenerator = $container->get('url-generator'); |
| 94 | - $this->cache = $container->get('cache'); |
|
| 94 | + $this->cache = $container->get('cache'); |
|
| 95 | 95 | $this->config = $container->get('config'); |
| 96 | 96 | $this->request = $container->get('request'); |
| 97 | 97 | $this->response = $container->get('response'); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | /** |
| 49 | 49 | * Constructor |
| 50 | 50 | * |
| 51 | - * @param ContainerInterface $container |
|
| 51 | + * @param \Aviat\Ion\Di\ContainerInterface $container |
|
| 52 | 52 | */ |
| 53 | 53 | public function __construct(ContainerInterface $container) |
| 54 | 54 | { |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /** |
| 3 | 3 | * Anime List Client |
| 4 | 4 | * |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ]; |
| 88 | 88 | |
| 89 | 89 | $data = ($status !== 'all') |
| 90 | - ? [$map[$status] => $this->model->getList($map[$status]) ] |
|
| 90 | + ? [$map[$status] => $this->model->getList($map[$status])] |
|
| 91 | 91 | : $this->model->getList('All'); |
| 92 | 92 | |
| 93 | 93 | $this->outputHTML('manga/' . $view_map[$view], [ |