diff --git a/public/css.php b/public/css.php index 3253765b..f9e81280 100644 --- a/public/css.php +++ b/public/css.php @@ -74,7 +74,7 @@ class CSSMin extends BaseMin { //Remove tabs, spaces, newlines, etc. $buffer = preg_replace('`\s+`', ' ', $buffer); - $replace = array( + $replace = [ ' )' => ')', ') ' => ')', ' }' => '}', @@ -84,7 +84,7 @@ class CSSMin extends BaseMin { ', ' => ',', ': ' => ':', '; ' => ';', - ); + ]; //Eradicate every last space! $buffer = trim(strtr($buffer, $replace)); @@ -101,7 +101,7 @@ class CSSMin extends BaseMin { */ protected function get_last_modified() { - $modified = array(); + $modified = []; // Get all the css files, and concatenate them together if(isset($this->group)) diff --git a/public/js.php b/public/js.php index e8f50232..8fa87bb5 100644 --- a/public/js.php +++ b/public/js.php @@ -168,7 +168,7 @@ class JSMin extends BaseMin { */ protected function get_last_modified() { - $modified = array(); + $modified = []; foreach($this->js_group as $file) { diff --git a/src/API/MAL/Transformer/AnimeListTransformer.php b/src/API/MAL/Transformer/AnimeListTransformer.php index 16f59d8a..6cabf5fe 100644 --- a/src/API/MAL/Transformer/AnimeListTransformer.php +++ b/src/API/MAL/Transformer/AnimeListTransformer.php @@ -24,7 +24,7 @@ use Aviat\Ion\Transformer\AbstractTransformer; */ class AnimeListTransformer extends AbstractTransformer { - const statusMap = [ + const STATUS_MAP = [ AnimeWatchingStatus::WATCHING => '1', AnimeWatchingStatus::COMPLETED => '2', AnimeWatchingStatus::ON_HOLD => '3', @@ -45,7 +45,7 @@ class AnimeListTransformer extends AbstractTransformer { return [ 'id' => $item['mal_id'], 'data' => [ - 'status' => self::statusMap[$item['watching_status']], + 'status' => self::STATUS_MAP[$item['watching_status']], 'rating' => $item['user_rating'], 'rewatch_value' => (int) $rewatching, 'times_rewatched' => $item['rewatched'], @@ -58,7 +58,7 @@ class AnimeListTransformer extends AbstractTransformer { /** * Transform Kitsu episode data to MAL episode data * - * @param array $item + * @param array $item * @return array */ public function untransform(array $item): array @@ -93,7 +93,7 @@ class AnimeListTransformer extends AbstractTransformer { break; case 'status': - $map['data']['status'] = self::statusMap[$value]; + $map['data']['status'] = self::STATUS_MAP[$value]; break; default: diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index 74b74fca..05ad50c2 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -15,7 +15,7 @@ class DispatcherTest extends AnimeClient_TestCase { protected $router; protected $config; - protected function _set_up($config, $uri, $host) + protected function doSetUp($config, $uri, $host) { // Set up the environment $_SERVER = array_merge($_SERVER, [ @@ -49,7 +49,7 @@ class DispatcherTest extends AnimeClient_TestCase { public function testRouterSanity() { - $this->_set_up([], '/', 'localhost'); + $this->doSetUp([], '/', 'localhost'); $this->assertTrue(is_object($this->router)); } @@ -130,11 +130,9 @@ class DispatcherTest extends AnimeClient_TestCase { */ public function testRoute($config, $controller, $host, $uri) { - $this->_set_up($config, $uri, $host); + $this->doSetUp($config, $uri, $host); $request = $this->container->get('request'); - $aura_router = $this->container->get('aura-router'); - // Check route setup $this->assertEquals($config['routes'], $this->config->get('routes'), "Incorrect route path"); @@ -191,7 +189,7 @@ class DispatcherTest extends AnimeClient_TestCase { ] ]; - $this->_set_up($config, "/", "localhost"); + $this->doSetUp($config, "/", "localhost"); $this->assertEquals('//localhost/manga/all', $this->urlGenerator->default_url('manga'), "Incorrect default url"); $this->assertEquals('//localhost/anime/watching', $this->urlGenerator->default_url('anime'), "Incorrect default url"); @@ -252,7 +250,7 @@ class DispatcherTest extends AnimeClient_TestCase { */ public function testGetControllerList($config, $expected) { - $this->_set_up($config, '/', 'localhost'); + $this->doSetUp($config, '/', 'localhost'); $this->assertEquals($expected, $this->router->getControllerList()); } } \ No newline at end of file diff --git a/tests/RoutingBaseTest.php b/tests/RoutingBaseTest.php index 6c6c9e66..f514972a 100644 --- a/tests/RoutingBaseTest.php +++ b/tests/RoutingBaseTest.php @@ -16,13 +16,13 @@ class RoutingBaseTest extends AnimeClient_TestCase { { return [ 'empty_segment' => [ - 'request_uri' => ' // ', + 'requestUri' => ' // ', 'path' => '/', 'segments' => ['', ''], 'last_segment' => NULL ], 'three_segments' => [ - 'request_uri' => '/anime/watching/list ', + 'requestUri' => '/anime/watching/list ', 'path' => '/anime/watching/list', 'segments' => ['', 'anime', 'watching', 'list'], 'last_segment' => 'list' @@ -33,11 +33,11 @@ class RoutingBaseTest extends AnimeClient_TestCase { /** * @dataProvider dataSegments */ - public function testSegments($request_uri, $path, $segments, $last_segment) + public function testSegments($requestUri, $path, $segments, $last_segment) { $this->setSuperGlobals([ '_SERVER' => [ - 'REQUEST_URI' => $request_uri + 'REQUEST_URI' => $requestUri ] ]); diff --git a/tests/TestSessionHandler.php b/tests/TestSessionHandler.php index 1c439cbd..487b01fa 100644 --- a/tests/TestSessionHandler.php +++ b/tests/TestSessionHandler.php @@ -5,7 +5,7 @@ namespace Aviat\AnimeClient\Tests; class TestSessionHandler implements \SessionHandlerInterface { public $data = []; - public $save_path = './test_data/sessions'; + public $savePath = './test_data/sessions'; public function close() { @@ -14,7 +14,7 @@ class TestSessionHandler implements \SessionHandlerInterface { public function destroy($id) { - $file = "$this->save_path/$id"; + $file = "$this->savePath/$id"; if (file_exists($file)) { @unlink($file); @@ -28,11 +28,11 @@ class TestSessionHandler implements \SessionHandlerInterface { return TRUE; } - public function open($save_path, $name) + public function open($savePath, $name) { - /*if ( ! array_key_exists($save_path, $this->data)) + /*if ( ! array_key_exists($savePath, $this->data)) { - $this->save_path = $save_path; + $this->savePath = $savePath; $this->data = []; }*/ return TRUE; @@ -40,12 +40,12 @@ class TestSessionHandler implements \SessionHandlerInterface { public function read($id) { - return json_decode(@file_get_contents("$this->save_path/$id"), TRUE); + return json_decode(@file_get_contents("$this->savePath/$id"), TRUE); } public function write($id, $data) { - $file = "$this->save_path/$id"; + $file = "$this->savePath/$id"; file_put_contents($file, json_encode($data)); return TRUE;