diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 94079d6..91afbff 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,9 +19,6 @@ jobs: strategy: matrix: php: - - "5.6" - - "7.0" - - "7.1" - "7.2" - "7.3" - "7.4" diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php new file mode 100644 index 0000000..460eecd --- /dev/null +++ b/.php-cs-fixer.php @@ -0,0 +1,30 @@ +in(__DIR__) + ->exclude(['vendor']) +; + +return (new PhpCsFixer\Config()) + ->setRiskyAllowed(true) + ->setRules([ + '@Symfony' => true, + '@Symfony:risky' => true, + 'array_syntax' => ['syntax' => 'short'], + 'combine_consecutive_unsets' => true, + 'heredoc_to_nowdoc' => true, + 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], + 'no_unreachable_default_argument_value' => true, + 'no_useless_else' => true, + 'no_useless_return' => true, + 'ordered_class_elements' => true, + 'ordered_imports' => true, + 'php_unit_strict' => true, + 'phpdoc_order' => true, + // 'psr4' => true, + 'strict_comparison' => true, + 'strict_param' => true, + 'concat_space' => ['spacing' => 'one'], + ]) + ->setFinder($finder) +; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 5184eaf..0000000 --- a/.php_cs +++ /dev/null @@ -1,45 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@Symfony' => true, - '@Symfony:risky' => true, - 'array_syntax' => [ - 'syntax' => 'short' - ], - 'combine_consecutive_unsets' => true, - 'heredoc_to_nowdoc' => true, - 'no_extra_consecutive_blank_lines' => [ - 'break', - 'continue', - 'extra', - 'return', - 'throw', - 'use', - 'parenthesis_brace_block', - 'square_brace_block', - 'curly_brace_block' - ], - 'no_unreachable_default_argument_value' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'ordered_class_elements' => true, - 'ordered_imports' => true, - 'php_unit_strict' => true, - 'phpdoc_order' => true, - // 'psr4' => true, - 'strict_comparison' => true, - 'strict_param' => true, - 'concat_space' => [ - 'spacing' => 'one' - ], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->exclude([ - 'vendor', - ]) - ->in(__DIR__) - ) -; diff --git a/README.md b/README.md index b492a05..01af9d3 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,8 @@ Uses [Imgur API v3](https://api.imgur.com/). * Branch [1.x](https://github.com/j0k3r/php-imgur-api-client/tree/1.x) use Guzzle 3 (but is not maintained) * Branch [2.x](https://github.com/j0k3r/php-imgur-api-client/tree/2.x) use Guzzle 5 (but is not maintained) -* Branch [master](https://github.com/j0k3r/php-imgur-api-client/tree/master) use Guzzle 6 - -All actives branches required PHP >= 5.6 +* Branch [3.x](https://github.com/j0k3r/php-imgur-api-client/tree/3.x) use Guzzle 6 and PHP >= 5.6 +* Branch [master](https://github.com/j0k3r/php-imgur-api-client/tree/master) use Guzzle 7 and PHP >= 7.2.5 ## Composer @@ -28,10 +27,8 @@ $ curl -s http://getcomposer.org/installer | php Add the library details to your composer.json -```json -"require": { - "j0k3r/php-imgur-api-client": "^3.0.0" -} +```bash +composer require j0k3r/php-imgur-api-client@^4.0 ``` Install the dependency with diff --git a/composer.json b/composer.json index d433d73..135988e 100644 --- a/composer.json +++ b/composer.json @@ -34,13 +34,13 @@ } }, "require": { - "php": ">=5.6.0", + "php": ">=7.2.5", "ext-curl": "*", - "guzzlehttp/guzzle": "^6.0" + "guzzlehttp/guzzle": "^7.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.0", - "symfony/phpunit-bridge": "^5.0" + "friendsofphp/php-cs-fixer": "^3.0", + "symfony/phpunit-bridge": "^6.0" }, "config": { "sort-packages": true diff --git a/lib/Imgur/Auth/OAuth2.php b/lib/Imgur/Auth/OAuth2.php index 5da0ce3..38752e5 100644 --- a/lib/Imgur/Auth/OAuth2.php +++ b/lib/Imgur/Auth/OAuth2.php @@ -12,8 +12,8 @@ */ class OAuth2 implements AuthInterface { - const AUTHORIZATION_ENDPOINT = 'https://api.imgur.com/oauth2/authorize'; - const ACCESS_TOKEN_ENDPOINT = 'https://api.imgur.com/oauth2/token'; + public const AUTHORIZATION_ENDPOINT = 'https://api.imgur.com/oauth2/authorize'; + public const ACCESS_TOKEN_ENDPOINT = 'https://api.imgur.com/oauth2/token'; /** * Indicates the client that is making the request.