From d3735861b892eb32c53ec6cf52641334c392c426 Mon Sep 17 00:00:00 2001 From: Anton Komarev <1849174+antonkomarev@users.noreply.github.com> Date: Fri, 1 Jan 2021 21:02:47 +0300 Subject: [PATCH] Add PHP 8 support (#51) * Add PHP 8 support --- .gitattributes | 1 - .gitignore | 1 - .php_cs | 64 ----------------------------- .travis.yml | 1 + CHANGELOG.md | 10 ++++- composer.json | 2 +- src/HttpClient/GuzzleHttpClient.php | 5 ++- 7 files changed, 15 insertions(+), 69 deletions(-) delete mode 100644 .php_cs diff --git a/.gitattributes b/.gitattributes index 3073007..57add99 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,7 +4,6 @@ /tests export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.php_cs export-ignore /.styleci.yml export-ignore /.travis.yml export-ignore /CODE_OF_CONDUCT.md export-ignore diff --git a/.gitignore b/.gitignore index 3f6349e..3a6361a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ /extras/ /vendor/ -.php_cs.cache .phpunit.result.cache composer.lock composer.phar diff --git a/.php_cs b/.php_cs deleted file mode 100644 index c045e14..0000000 --- a/.php_cs +++ /dev/null @@ -1,64 +0,0 @@ -notPath('bootstrap/cache') - ->notPath('storage') - ->notPath('vendor') - ->in(__DIR__) - ->name('*.php') - ->ignoreDotFiles(true) - ->ignoreVCS(true); - -$fixers = [ - '-psr0', - '-php_closing_tag', - 'blankline_after_open_tag', - '-concat_without_spaces', - 'double_arrow_multiline_whitespaces', - 'duplicate_semicolon', - 'empty_return', - 'extra_empty_lines', - 'include', - 'join_function', - 'list_commas', - 'multiline_array_trailing_comma', - 'namespace_no_leading_whitespace', - 'newline_after_open_tag', - 'no_blank_lines_after_class_opening', - 'no_empty_lines_after_phpdocs', - 'object_operator', - 'operators_spaces', - 'phpdoc_indent', - 'phpdoc_no_access', - '-phpdoc_no_package', - 'phpdoc_scalar', - 'phpdoc_short_description', - 'phpdoc_to_comment', - 'phpdoc_trim', - 'phpdoc_type_to_var', - 'phpdoc_var_without_name', - 'remove_leading_slash_use', - 'remove_lines_between_uses', - 'return', - 'self_accessor', - 'single_array_no_trailing_comma', - 'single_blank_line_before_namespace', - 'single_quote', - 'spaces_before_semicolon', - 'spaces_cast', - 'standardize_not_equal', - 'ternary_spaces', - 'trim_array_spaces', - 'unalign_equals', - 'unary_operators_spaces', - 'whitespacy_lines', - 'multiline_spaces_before_semicolon', - 'short_array_syntax', - 'short_echo_tag', -]; - -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers($fixers) - ->finder($finder) - ->setUsingCache(true); \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 99c11ee..f2d6ef9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ php: - 7.2 - 7.3 - 7.4 + - 8.0 env: global: diff --git a/CHANGELOG.md b/CHANGELOG.md index 5af0055..9809a04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to `cybercog/youtrack-rest-php` will be documented in this f ## [Unreleased] +## [6.3.0] - 2021-01-01 + +### Added + +- ([#51]) Added PHP 8.x support + ## [6.2.2] - 2020-07-19 ### Fixed @@ -116,7 +122,8 @@ All notable changes to `cybercog/youtrack-rest-php` will be documented in this f - Initial release. -[Unreleased]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.2...master +[Unreleased]: https://github.com/cybercog/youtrack-rest-php/compare/6.3.0...master +[6.3.0]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.2...6.3.0 [6.2.2]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.1...6.2.2 [6.2.1]: https://github.com/cybercog/youtrack-rest-php/compare/6.2.0...6.2.1 [6.2.0]: https://github.com/cybercog/youtrack-rest-php/compare/6.1.0...6.2.0 @@ -130,6 +137,7 @@ All notable changes to `cybercog/youtrack-rest-php` will be documented in this f [3.0.0]: https://github.com/cybercog/youtrack-rest-php/compare/2.0.1...3.0.0 [2.0.1]: https://github.com/cybercog/youtrack-rest-php/compare/1.0.0...2.0.1 +[#51]: https://github.com/cybercog/youtrack-rest-php/pull/51 [#49]: https://github.com/cybercog/youtrack-rest-php/pull/49 [#48]: https://github.com/cybercog/youtrack-rest-php/pull/48 [#43]: https://github.com/cybercog/youtrack-rest-php/pull/43 diff --git a/composer.json b/composer.json index 82e30f3..1073ac3 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "docs": "https://github.com/cybercog/youtrack-rest-php/wiki" }, "require": { - "php": "^7.1", + "php": "^7.1|^8.0", "ext-json": "*", "guzzlehttp/guzzle": "^6.2", "phpstan/phpstan": "^0.12.32" diff --git a/src/HttpClient/GuzzleHttpClient.php b/src/HttpClient/GuzzleHttpClient.php index e39f316..023cd28 100644 --- a/src/HttpClient/GuzzleHttpClient.php +++ b/src/HttpClient/GuzzleHttpClient.php @@ -88,7 +88,10 @@ private function appendUserAgent(array $options): array { $defaultAgent = 'GuzzleHttp/' . Client::VERSION; if (extension_loaded('curl') && function_exists('curl_version')) { - $defaultAgent .= ' curl/' . \curl_version()['version']; + $curlVersion = \curl_version(); + if (\is_array($curlVersion)) { + $defaultAgent .= ' curl/' . $curlVersion['version']; + } } $defaultAgent .= ' PHP/' . PHP_VERSION;