From dd2d25d54cf12e7331948adf15c61ff197fd77df Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Tue, 30 Aug 2016 10:57:41 -0400 Subject: [PATCH] Code style fixes to satisfy phpcs --- .travis.yml | 4 +- .../Operators/LogicalOperatorAndSniff.php | 4 +- .../StrictComparisonOperatorSniff.php | 2 +- .../WhiteSpace/DisallowSpaceIndentSniff.php | 2 +- build/animeclient_header_comment.txt | 4 +- build/phpcs.xml | 9 +- build/update_header_comments.php | 4 +- index.php | 10 +- phpdoc.dist.xml | 5 +- src/Command/CacheImages.php | 21 +- src/Controller.php | 10 +- src/Controller/Anime.php | 9 +- src/Controller/Manga.php | 14 +- src/Dispatcher.php | 1 + src/Model/API.php | 8 +- src/Model/Anime.php | 19 +- src/Model/AnimeCollection.php | 2 +- src/Model/Collection.php | 2 +- src/Model/Manga.php | 4 +- src/UrlGenerator.php | 4 +- src/Util.php | 397 +++++++++--------- 21 files changed, 288 insertions(+), 247 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8de0e34a..f5cce27a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: php install: - - composer install --no-dev + - composer install php: - 5.5 @@ -17,7 +17,7 @@ before_script: script: - mkdir -p build/logs - phpunit -c build - + services: - redis diff --git a/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php b/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php index 072181b5..d7af22aa 100644 --- a/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php +++ b/build/CodeIgniter/Sniffs/Operators/LogicalOperatorAndSniff.php @@ -67,11 +67,11 @@ class LogicalOperatorAndSniff implements Sniff $error_message = 'Logical operator should be in upper case;' . ' use "' . strtoupper($operator_string) . '" instead of "' . $operator_string . '"'; - $phpcsFile->addError($error_message, $stackPtr); + $phpcsFile->addError($error_message, $stackPtr, 'LowercaseLogicalOperator'); } $warning_message = 'The symbolic form "&&" is preferred over the literal form "AND"'; - $phpcsFile->addWarning($warning_message, $stackPtr); + $phpcsFile->addWarning($warning_message, $stackPtr, 'UseOfLiteralAndOperator'); }//end process() diff --git a/build/CodeIgniter/Sniffs/Operators/StrictComparisonOperatorSniff.php b/build/CodeIgniter/Sniffs/Operators/StrictComparisonOperatorSniff.php index fe229f62..e30a1a05 100755 --- a/build/CodeIgniter/Sniffs/Operators/StrictComparisonOperatorSniff.php +++ b/build/CodeIgniter/Sniffs/Operators/StrictComparisonOperatorSniff.php @@ -72,7 +72,7 @@ class StrictComparisonOperatorSniff implements Sniff $error_message = '"==" and "!=" are prohibited; use "' . self::$_replacements[$operator_code] . '" instead of "' . $operator_string . '".'; - $phpcsFile->addError($error_message, $stackPtr); + $phpcsFile->addError($error_message, $stackPtr, 'NonStrictComparisonUsed'); }//end process() diff --git a/build/CodeIgniter/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php b/build/CodeIgniter/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php index 55eb4d9b..933dccae 100755 --- a/build/CodeIgniter/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php +++ b/build/CodeIgniter/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php @@ -77,7 +77,7 @@ class DisallowSpaceIndentSniff implements Sniff if (strpos($tokens[$stackPtr]['content'], " ") !== false) { $error = 'Tabs must be used to indent lines; spaces are not allowed for code indentation'; - $phpcsFile->addError($error, $stackPtr); + $phpcsFile->addError($error, $stackPtr, 'SpacesUsedForIndentation'); } }//end process() diff --git a/build/animeclient_header_comment.txt b/build/animeclient_header_comment.txt index 66b34887..fafb11dd 100644 --- a/build/animeclient_header_comment.txt +++ b/build/animeclient_header_comment.txt @@ -8,7 +8,7 @@ * @package HummingbirdAnimeClient * @author Timothy J. Warren * @copyright 2015 - 2016 Timothy J. Warren - * @link https://github.com/timw4mail/HummingBirdAnimeClient + * @license http://www.opensource.org/licenses/mit-license.html MIT License * @version 3.1 - * @license MIT + * @link https://github.com/timw4mail/HummingBirdAnimeClient */ \ No newline at end of file diff --git a/build/phpcs.xml b/build/phpcs.xml index 58d9c542..bea1fc42 100644 --- a/build/phpcs.xml +++ b/build/phpcs.xml @@ -25,6 +25,8 @@ + + @@ -37,9 +39,10 @@ + - + @@ -58,7 +61,9 @@ - + + + diff --git a/build/update_header_comments.php b/build/update_header_comments.php index a7423f3b..662814e8 100644 --- a/build/update_header_comments.php +++ b/build/update_header_comments.php @@ -2,9 +2,9 @@ $animeclient_file_patterns = [ 'app/config/*.php', - 'app/booststrap.php', + 'app/bootstrap.php', 'src/functions.php', - 'src/Aviat/AnimeClient/*.php' + 'src/*.php' ]; if ( ! function_exists('glob_recursive')) diff --git a/index.php b/index.php index edab666c..6db078c5 100644 --- a/index.php +++ b/index.php @@ -4,15 +4,17 @@ * * An API client for Hummingbird to manage anime and manga watch lists * + * PHP version 5.6 + * * @package HummingbirdAnimeClient - * @author Timothy J. Warren - * @copyright Copyright (c) 2015 - 2016 + * @author Timothy J. Warren + * @copyright 2015 - 2016 Timothy J. Warren + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @version 3.1 * @link https://github.com/timw4mail/HummingBirdAnimeClient - * @license MIT */ use Aviat\AnimeClient\AnimeClient; use Whoops\Handler\PrettyPageHandler; -use Whoops\Handler\JsonResponseHandler; // Work around the silly timezone error $timezone = ini_get('date.timezone'); diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml index ce3e6389..662d583a 100644 --- a/phpdoc.dist.xml +++ b/phpdoc.dist.xml @@ -8,10 +8,11 @@ phpdoc -