From dd7e3a77f45675b970f14caa74db6744886247e6 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 3 Dec 2021 10:28:07 +0100 Subject: [PATCH 1/3] Guzzle 7 and prepare 4.0 --- .github/workflows/continuous-integration.yml | 2 - .php-cs-fixer.php | 30 +++++++++++++ .php_cs | 45 -------------------- README.md | 11 ++--- composer.json | 8 ++-- lib/Imgur/Auth/OAuth2.php | 4 +- 6 files changed, 40 insertions(+), 60 deletions(-) create mode 100644 .php-cs-fixer.php delete mode 100644 .php_cs diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 94079d6..9d9a1d4 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,8 +19,6 @@ jobs: strategy: matrix: php: - - "5.6" - - "7.0" - "7.1" - "7.2" - "7.3" 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..37779e6 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.1.3 ## 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..ac045d1 100644 --- a/composer.json +++ b/composer.json @@ -34,13 +34,13 @@ } }, "require": { - "php": ">=5.6.0", + "php": ">=7.1.3", "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. From 3eb9b4c4350be4c319ee2d45f82f95c2b58b6f77 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 3 Dec 2021 10:30:15 +0100 Subject: [PATCH 2/3] PHP 7.2.5 because of Guzzle :) --- README.md | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 37779e6..01af9d3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ 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 [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.1.3 +* Branch [master](https://github.com/j0k3r/php-imgur-api-client/tree/master) use Guzzle 7 and PHP >= 7.2.5 ## Composer diff --git a/composer.json b/composer.json index ac045d1..135988e 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ } }, "require": { - "php": ">=7.1.3", + "php": ">=7.2.5", "ext-curl": "*", "guzzlehttp/guzzle": "^7.0" }, From 6377172d303326ed822d5b26eca84a8fcd2257f8 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 3 Dec 2021 10:31:05 +0100 Subject: [PATCH 3/3] Remove 7.1 build --- .github/workflows/continuous-integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 9d9a1d4..91afbff 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,7 +19,6 @@ jobs: strategy: matrix: php: - - "7.1" - "7.2" - "7.3" - "7.4"