From bbcbb72c9eb190f45068360d5908bcc499841130 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 24 Aug 2024 13:22:18 -0400 Subject: [PATCH 01/23] Add flair --- README.md | 33 ++++++++++++++++---------------- scripts/update_readme_methods.sh | 6 +++--- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index b706f557a4..87eef2ccdc 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,18 @@ PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. --- -- [Installation](#installation) -- [Requirements](#requirements) -- [Quick Start and Examples](#quick-start-and-examples) -- [Available Methods](#available-methods) -- [Security](#security) -- [Troubleshooting](#troubleshooting) -- [Testing](#testing) -- [Contributing](#contributing) +- [โš™๏ธ Installation](#โš™๏ธ-installation) +- [๐Ÿ“‹ Requirements](#๐Ÿ“‹-requirements) +- [๐Ÿš€ Quick Start and Examples](#๐Ÿš€-quick-start-and-examples) +- [๐Ÿ“– Available Methods](#๐Ÿ“–-available-methods) +- [๐Ÿ”’ Security](#๐Ÿ”’-security) +- [๐Ÿ› ๏ธ Troubleshooting](#๐Ÿ› ๏ธ-troubleshooting) +- [๐Ÿงช Testing](#๐Ÿงช-testing) +- [๐Ÿค Contributing](#๐Ÿค-contributing) --- -### Installation +### โš™๏ธ Installation To install PHP Curl Class, run the following command: @@ -35,11 +35,11 @@ To install the latest commit version: Installation instructions to use the `composer` command can be found on https://github.com/composer/composer. -### Requirements +### ๐Ÿ“‹ Requirements PHP Curl Class works with PHP 8.3, 8.2, 8.1, 8.0, and 7.4. -### Quick Start and Examples +### ๐Ÿš€ Quick Start and Examples More examples are available under [/examples](https://github.com/php-curl-class/php-curl-class/tree/master/examples). @@ -194,7 +194,7 @@ $multi_curl->start(); // Blocks until all items in the queue have been processed More examples are available under [/examples](https://github.com/php-curl-class/php-curl-class/tree/master/examples). -### Available Methods +### ๐Ÿ“– Available Methods ```php Curl::__construct($base_url = null, $options = []) Curl::__destruct() @@ -329,6 +329,7 @@ MultiCurl::close() MultiCurl::complete($callback) MultiCurl::disableTimeout() MultiCurl::error($callback) +MultiCurl::getActiveCurls() MultiCurl::getOpt($option) MultiCurl::removeHeader($key) MultiCurl::setAutoReferer($auto_referer = true) @@ -376,19 +377,19 @@ MultiCurl::unsetProxy() MultiCurl::verbose($on = true, $output = 'STDERR') ``` -### Security +### ๐Ÿ”’ Security See [SECURITY](https://github.com/php-curl-class/php-curl-class/blob/master/SECURITY.md) for security considerations. -### Troubleshooting +### ๐Ÿ› ๏ธ Troubleshooting See [TROUBLESHOOTING](https://github.com/php-curl-class/php-curl-class/blob/master/TROUBLESHOOTING.md) for help troubleshooting. -### Testing +### ๐Ÿงช Testing See [TESTING](https://github.com/php-curl-class/php-curl-class/blob/master/TESTING.md) for testing information. -### Contributing +### ๐Ÿค Contributing 1. Check for open issues or open a new issue to start a discussion around a bug or feature. 1. Fork the repository on GitHub to start making your changes. diff --git a/scripts/update_readme_methods.sh b/scripts/update_readme_methods.sh index 4a658c161e..485eddfaa8 100755 --- a/scripts/update_readme_methods.sh +++ b/scripts/update_readme_methods.sh @@ -4,11 +4,11 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}/.." before=$(head -n $( - grep --context="0" --line-number --max-count="1" "### Available Methods" "README.md" | + grep --context="0" --line-number --max-count="1" "### ๐Ÿ“– Available Methods" "README.md" | perl -pe 's/^(\d+):.*/\1/') "README.md") after=$(tail -n +$( - grep --context="0" --line-number --max-count="1" "### Security" "README.md" | + grep --context="0" --line-number --max-count="1" "### ๐Ÿ”’ Security" "README.md" | perl -pe 's/^(\d+):.*/\1/') "README.md") echo "${before}" > "README.md" @@ -48,7 +48,7 @@ echo "${after}" >> "README.md" # Update table of contents. script=$(cat <<'EOF' $data = file_get_contents('README.md'); - preg_match_all('/^### ([\w ]+)/m', $data, $matches); + preg_match_all('/^### (.*)/m', $data, $matches); $toc = []; foreach ($matches['1'] as $match) { $href = '#' . str_replace(' ', '-', strtolower($match)); From 357d1201a0a0766d94f0930a34e331959cc6e998 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 24 Aug 2024 13:35:48 -0400 Subject: [PATCH 02/23] Attempt to fix links in the table of contents --- README.md | 16 ++++++++-------- scripts/update_readme_methods.sh | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 87eef2ccdc..9a9f0d599c 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,14 @@ PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. --- -- [โš™๏ธ Installation](#โš™๏ธ-installation) -- [๐Ÿ“‹ Requirements](#๐Ÿ“‹-requirements) -- [๐Ÿš€ Quick Start and Examples](#๐Ÿš€-quick-start-and-examples) -- [๐Ÿ“– Available Methods](#๐Ÿ“–-available-methods) -- [๐Ÿ”’ Security](#๐Ÿ”’-security) -- [๐Ÿ› ๏ธ Troubleshooting](#๐Ÿ› ๏ธ-troubleshooting) -- [๐Ÿงช Testing](#๐Ÿงช-testing) -- [๐Ÿค Contributing](#๐Ÿค-contributing) +- [โš™๏ธ Installation](#-installation) +- [๐Ÿ“‹ Requirements](#-requirements) +- [๐Ÿš€ Quick Start and Examples](#-quick-start-and-examples) +- [๐Ÿ“– Available Methods](#-available-methods) +- [๐Ÿ”’ Security](#-security) +- [๐Ÿ› ๏ธ Troubleshooting](#-troubleshooting) +- [๐Ÿงช Testing](#-testing) +- [๐Ÿค Contributing](#-contributing) --- diff --git a/scripts/update_readme_methods.sh b/scripts/update_readme_methods.sh index 485eddfaa8..ff9fa24bc9 100755 --- a/scripts/update_readme_methods.sh +++ b/scripts/update_readme_methods.sh @@ -51,7 +51,8 @@ script=$(cat <<'EOF' preg_match_all('/^### (.*)/m', $data, $matches); $toc = []; foreach ($matches['1'] as $match) { - $href = '#' . str_replace(' ', '-', strtolower($match)); + $slug = strtolower(preg_replace('/[^A-Za-z-]/', '', str_replace(' ', '-', $match))); + $href = '#' . $slug; $toc[] = '- [' . $match . '](' . $href . ')'; } $toc = implode("\n", $toc); From 28abb78e2e5cc061f2b31c7ab0c1aae635dfcf1f Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 24 Aug 2024 14:11:30 -0400 Subject: [PATCH 03/23] Fix links in table of contents caused by variation selector-16 (U+FE0F) --- README.md | 4 ++-- scripts/update_readme_methods.sh | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a9f0d599c..823d5239c6 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,12 @@ PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. --- -- [โš™๏ธ Installation](#-installation) +- [โš™๏ธ Installation](#%EF%B8%8F-installation) - [๐Ÿ“‹ Requirements](#-requirements) - [๐Ÿš€ Quick Start and Examples](#-quick-start-and-examples) - [๐Ÿ“– Available Methods](#-available-methods) - [๐Ÿ”’ Security](#-security) -- [๐Ÿ› ๏ธ Troubleshooting](#-troubleshooting) +- [๐Ÿ› ๏ธ Troubleshooting](#%EF%B8%8F-troubleshooting) - [๐Ÿงช Testing](#-testing) - [๐Ÿค Contributing](#-contributing) diff --git a/scripts/update_readme_methods.sh b/scripts/update_readme_methods.sh index ff9fa24bc9..5c8574513e 100755 --- a/scripts/update_readme_methods.sh +++ b/scripts/update_readme_methods.sh @@ -51,7 +51,19 @@ script=$(cat <<'EOF' preg_match_all('/^### (.*)/m', $data, $matches); $toc = []; foreach ($matches['1'] as $match) { - $slug = strtolower(preg_replace('/[^A-Za-z-]/', '', str_replace(' ', '-', $match))); + $slug = urlencode( + strtolower( + str_replace( + ' ', + '-', + preg_replace( + '/[^A-Za-z\x{FE0F} ]/u', + '', + $match, + ), + ) + ) + ); $href = '#' . $slug; $toc[] = '- [' . $match . '](' . $href . ')'; } From eef57a9cb96ed7719f886d09154b187fea245e35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:32:34 +0000 Subject: [PATCH 04/23] Bump pygithub from 2.3.0 to 2.4.0 Bumps [pygithub](https://github.com/pygithub/pygithub) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/pygithub/pygithub/releases) - [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst) - [Commits](https://github.com/pygithub/pygithub/compare/v2.3.0...v2.4.0) --- updated-dependencies: - dependency-name: pygithub dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- scripts/make_release_requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/make_release_requirements.txt b/scripts/make_release_requirements.txt index e325a4d70a..a5701e1c1c 100644 --- a/scripts/make_release_requirements.txt +++ b/scripts/make_release_requirements.txt @@ -19,13 +19,13 @@ deprecated==1.2.14 gitdb==4.0.11 # via gitpython gitpython==3.1.43 - # via -r make_release_requirements.in + # via -r scripts/make_release_requirements.in idna==3.7 # via requests pycparser==2.22 # via cffi -pygithub==2.3.0 - # via -r make_release_requirements.in +pygithub==2.4.0 + # via -r scripts/make_release_requirements.in pyjwt[crypto]==2.8.0 # via pygithub pynacl==1.5.0 From 8710ecc505c74b2f8c0c29a5a2bcf035841bac39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 00:20:21 +0000 Subject: [PATCH 05/23] Bump cryptography from 42.0.5 to 43.0.1 in /scripts Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.5 to 43.0.1. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/42.0.5...43.0.1) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] --- scripts/make_release_requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/make_release_requirements.txt b/scripts/make_release_requirements.txt index a5701e1c1c..dbb19b70f2 100644 --- a/scripts/make_release_requirements.txt +++ b/scripts/make_release_requirements.txt @@ -12,20 +12,20 @@ cffi==1.16.0 # pynacl charset-normalizer==3.3.2 # via requests -cryptography==42.0.5 +cryptography==43.0.1 # via pyjwt deprecated==1.2.14 # via pygithub gitdb==4.0.11 # via gitpython gitpython==3.1.43 - # via -r scripts/make_release_requirements.in + # via -r make_release_requirements.in idna==3.7 # via requests pycparser==2.22 # via cffi pygithub==2.4.0 - # via -r scripts/make_release_requirements.in + # via -r make_release_requirements.in pyjwt[crypto]==2.8.0 # via pygithub pynacl==1.5.0 From f59e512f3bbfbb5abe92b0c5b356cd78dcc7b783 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 14:34:58 +0000 Subject: [PATCH 06/23] Bump peter-evans/create-pull-request from 6 to 7 (#892) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pre-commit-auto-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pre-commit-auto-update.yml b/.github/workflows/pre-commit-auto-update.yml index 74f8c58b55..cf9d376277 100644 --- a/.github/workflows/pre-commit-auto-update.yml +++ b/.github/workflows/pre-commit-auto-update.yml @@ -34,7 +34,7 @@ jobs: - name: Create or update pull request id: cpr - uses: peter-evans/create-pull-request@v6 + uses: peter-evans/create-pull-request@v7 with: commit-message: Update pre-commit dependencies labels: cleanup-no-release-required, dependencies, github_actions From 6bdaf9b5f9a6b64ad59f717f33e967b59e6a9728 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 09:55:08 +0000 Subject: [PATCH 07/23] Update vimeo/psalm requirement from >=5.25.0 to >=5.26.0 Updates the requirements on [vimeo/psalm](https://github.com/vimeo/psalm) to permit the latest version. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/5.25.0...5.26.0) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 78222991bc..1f474c6fa7 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "phpcsstandards/phpcsutils": "@alpha", "phpunit/phpunit": "*", "squizlabs/php_codesniffer": "*", - "vimeo/psalm": ">=5.25.0" + "vimeo/psalm": ">=5.26.0" }, "suggest": { "ext-mbstring": "*" From 95e9033a52dcf91e781394f915f38679b2b4cc4f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:24:19 +0000 Subject: [PATCH 08/23] Update vimeo/psalm requirement from >=5.26.0 to >=5.26.1 Updates the requirements on [vimeo/psalm](https://github.com/vimeo/psalm) to permit the latest version. - [Release notes](https://github.com/vimeo/psalm/releases) - [Commits](https://github.com/vimeo/psalm/compare/5.26.0...5.26.1) --- updated-dependencies: - dependency-name: vimeo/psalm dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1f474c6fa7..8da6c71722 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,7 @@ "phpcsstandards/phpcsutils": "@alpha", "phpunit/phpunit": "*", "squizlabs/php_codesniffer": "*", - "vimeo/psalm": ">=5.26.0" + "vimeo/psalm": ">=5.26.1" }, "suggest": { "ext-mbstring": "*" From c40be1084edf43aae060675a21a080b4c820985b Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Mon, 7 Oct 2024 21:49:42 -0400 Subject: [PATCH 09/23] Fix phpcs warning (#897) FILE: ...e/runner/work/php-curl-class/php-curl-class/tests/PHPCurlClass/UrlTest.php -------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES -------------------------------------------------------------------------------- 14 | WARNING | The $escape parameter must be passed when calling fgetcsv() as | | its default value will change in a future PHP version. | | (PHPCompatibility.ParameterValues.RemovedProprietaryCSVEscaping.DeprecatedParamNotPassed) 15 | WARNING | The $escape parameter must be passed when calling fgetcsv() as | | its default value will change in a future PHP version. | | (PHPCompatibility.ParameterValues.RemovedProprietaryCSVEscaping.DeprecatedParamNotPassed) -------------------------------------------------------------------------------- --- tests/PHPCurlClass/UrlTest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/PHPCurlClass/UrlTest.php b/tests/PHPCurlClass/UrlTest.php index 1d445f77ea..397793565e 100644 --- a/tests/PHPCurlClass/UrlTest.php +++ b/tests/PHPCurlClass/UrlTest.php @@ -11,8 +11,12 @@ class UrlTest extends \PHPUnit\Framework\TestCase public function testUrlPaths() { $urls_file = gzopen(__DIR__ . '/urls.csv.gz', 'r'); - fgetcsv($urls_file); // header - while (($test = fgetcsv($urls_file)) !== false) { + $length = null; + $separator = ","; + $enclosure = "\""; + $escape = "\\"; + fgetcsv($urls_file, $length, $separator, $enclosure, $escape); // header + while (($test = fgetcsv($urls_file, $length, $separator, $enclosure, $escape)) !== false) { $url = new Url($test[0], $test[1]); $actual_url = (string)$url; $expected_url = $test[2]; From 301e590864d566661e127a9207d4a46d18b25e91 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Oct 2024 18:04:26 +0000 Subject: [PATCH 10/23] Update pre-commit dependencies --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0966ee676d..726d8f3b15 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ # $ pre-commit autoupdate repos: - repo: https://github.com/psf/black - rev: 24.8.0 + rev: 24.10.0 hooks: - id: black name: black From e4b2712001601e68a4e27e6ac4b32813027e9cd6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:42:01 +0000 Subject: [PATCH 11/23] Bump pygithub from 2.4.0 to 2.5.0 Bumps [pygithub](https://github.com/pygithub/pygithub) from 2.4.0 to 2.5.0. - [Release notes](https://github.com/pygithub/pygithub/releases) - [Changelog](https://github.com/PyGithub/PyGithub/blob/main/doc/changes.rst) - [Commits](https://github.com/pygithub/pygithub/compare/v2.4.0...v2.5.0) --- updated-dependencies: - dependency-name: pygithub dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- scripts/make_release_requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/make_release_requirements.txt b/scripts/make_release_requirements.txt index dbb19b70f2..e9959659a3 100644 --- a/scripts/make_release_requirements.txt +++ b/scripts/make_release_requirements.txt @@ -19,13 +19,13 @@ deprecated==1.2.14 gitdb==4.0.11 # via gitpython gitpython==3.1.43 - # via -r make_release_requirements.in + # via -r scripts/make_release_requirements.in idna==3.7 # via requests pycparser==2.22 # via cffi -pygithub==2.4.0 - # via -r make_release_requirements.in +pygithub==2.5.0 + # via -r scripts/make_release_requirements.in pyjwt[crypto]==2.8.0 # via pygithub pynacl==1.5.0 From a041ac97db7145ab79d99692ae1d63c4c2e8bbb4 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Wed, 4 Dec 2024 09:39:33 -0500 Subject: [PATCH 12/23] Add PHP 8.4 as supported (#900) * Add PHP 8.4 as supported * Add temporary workaround that manually install psalm on currently supported versions --- .github/workflows/ci.yml | 7 +++++-- README.md | 2 +- composer.json | 3 +-- tests/check_coding_standards.sh | 7 +++++++ tests/ci.sh | 13 +++++++++++++ 5 files changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb6ae594a4..9ec098f84a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,9 +20,10 @@ jobs: - '8.1' - '8.2' - '8.3' + - '8.4' future-release: [false] include: - - php-version: '8.4' + - php-version: '8.5' future-release: true fail-fast: false name: PHP ${{ matrix.php-version }} @@ -47,4 +48,6 @@ jobs: - name: Static analysis run: 'vendor/bin/psalm --config="tests/psalm.xml"' - if: ${{ !matrix.future-release }} + # TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm + # supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107). + if: ${{ !matrix.future-release && matrix.php-version < 8.4 }} diff --git a/README.md b/README.md index 823d5239c6..f96077774e 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Installation instructions to use the `composer` command can be found on https:// ### ๐Ÿ“‹ Requirements -PHP Curl Class works with PHP 8.3, 8.2, 8.1, 8.0, and 7.4. +PHP Curl Class works with PHP 8.4, 8.3, 8.2, 8.1, 8.0, and 7.4. ### ๐Ÿš€ Quick Start and Examples diff --git a/composer.json b/composer.json index 8da6c71722..89fb33a3e4 100644 --- a/composer.json +++ b/composer.json @@ -28,8 +28,7 @@ "phpcompatibility/php-compatibility": "dev-develop", "phpcsstandards/phpcsutils": "@alpha", "phpunit/phpunit": "*", - "squizlabs/php_codesniffer": "*", - "vimeo/psalm": ">=5.26.1" + "squizlabs/php_codesniffer": "*" }, "suggest": { "ext-mbstring": "*" diff --git a/tests/check_coding_standards.sh b/tests/check_coding_standards.sh index b1ab3a65bc..6c45a848f5 100755 --- a/tests/check_coding_standards.sh +++ b/tests/check_coding_standards.sh @@ -114,6 +114,11 @@ if [[ "${?}" -ne 0 ]]; then errors+=("found PHP_CodeSniffer coding standard violation(s)") fi +# TODO: Remove this workaround that only runs php-cs-fixer on PHP < 8.4 when +# php-cs-fixer supports PHP 8.4. +# https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/8300 +if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then + # Run PHP-CS-Fixer. vendor/bin/php-cs-fixer --version vendor/bin/php-cs-fixer fix --ansi --config="tests/.php-cs-fixer.php" --diff --dry-run @@ -121,3 +126,5 @@ if [[ "${?}" -ne 0 ]]; then echo "Error: found PHP-CS-Fixer coding standard violation(s)" errors+=("found PHP-CS-Fixer coding standard violation(s)") fi + +fi diff --git a/tests/ci.sh b/tests/ci.sh index 6b5489cc1d..c3d6d76273 100755 --- a/tests/ci.sh +++ b/tests/ci.sh @@ -60,6 +60,19 @@ phpunit_v10_shim() { set -x composer self-update + +# TODO: Add "vimeo/psalm" back into composer.json under "require-dev" when +# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): +# "require-dev": { +# "vimeo/psalm": ">=5.26.1" +# }, +# +# TODO: Remove this workaround that only installs vimeo/psalm on PHP < 8.4 when +# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): +if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then + composer require --dev "vimeo/psalm:>=5.26.1" +fi + composer install --prefer-source --no-interaction # Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable. From 7b22d3541daffd66bf80d10c2a1c467e3dedfb0c Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Tue, 17 Dec 2024 21:32:25 -0500 Subject: [PATCH 13/23] Update badge styles (#901) --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f96077774e..78d47a8ab3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # PHP Curl Class: HTTP requests made easy -[![](https://img.shields.io/github/release/php-curl-class/php-curl-class.svg?style=flat-square&sort=semver)](https://github.com/php-curl-class/php-curl-class/releases/) -[![](https://img.shields.io/github/license/php-curl-class/php-curl-class.svg?style=flat-square)](https://github.com/php-curl-class/php-curl-class/blob/master/LICENSE) -[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/ci.yml?style=flat-square&label=build&branch=master)](https://github.com/php-curl-class/php-curl-class/actions/workflows/ci.yml) -[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/release.yml?style=flat-square&label=release&branch=master)](https://github.com/php-curl-class/php-curl-class/releases/) -[![](https://img.shields.io/packagist/dt/php-curl-class/php-curl-class.svg?style=flat-square)](https://github.com/php-curl-class/php-curl-class/releases/) +[![](https://img.shields.io/github/release/php-curl-class/php-curl-class.svg?style=for-the-badge&sort=semver)](https://github.com/php-curl-class/php-curl-class/releases/) +[![](https://img.shields.io/github/license/php-curl-class/php-curl-class.svg?style=for-the-badge)](https://github.com/php-curl-class/php-curl-class/blob/master/LICENSE) +[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/ci.yml?style=for-the-badge&label=build&branch=master)](https://github.com/php-curl-class/php-curl-class/actions/workflows/ci.yml) +[![](https://img.shields.io/github/actions/workflow/status/php-curl-class/php-curl-class/release.yml?style=for-the-badge&label=release&branch=master)](https://github.com/php-curl-class/php-curl-class/releases/) +[![](https://img.shields.io/packagist/dt/php-curl-class/php-curl-class.svg?style=for-the-badge)](https://github.com/php-curl-class/php-curl-class/releases/) PHP Curl Class makes it easy to send HTTP requests and integrate with web APIs. From 7df3e04406bc6ae84523b2edd0eed09e8adebdd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 09:09:26 +0000 Subject: [PATCH 14/23] Bump gitpython from 3.1.43 to 3.1.44 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.43 to 3.1.44. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.43...3.1.44) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- scripts/make_release_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/make_release_requirements.txt b/scripts/make_release_requirements.txt index e9959659a3..73dcd7ed81 100644 --- a/scripts/make_release_requirements.txt +++ b/scripts/make_release_requirements.txt @@ -18,7 +18,7 @@ deprecated==1.2.14 # via pygithub gitdb==4.0.11 # via gitpython -gitpython==3.1.43 +gitpython==3.1.44 # via -r scripts/make_release_requirements.in idna==3.7 # via requests From a11ecf6d7b75cfb0546876a72e628f5ba7b5b620 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Thu, 9 Jan 2025 22:30:06 -0500 Subject: [PATCH 15/23] Clean up (#904) --- tests/ci.sh | 4 ++-- tests/run.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ci.sh b/tests/ci.sh index c3d6d76273..ccdaefc09e 100755 --- a/tests/ci.sh +++ b/tests/ci.sh @@ -27,9 +27,9 @@ replace_assertMatchesRegularExpression() { find='->assertMatchesRegularExpression(' replace='->assertRegExp(' if sed v < /dev/null 2> /dev/null; then - sed -i"" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* + sed -i"" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* else - sed -i "" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* + sed -i "" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* fi } diff --git a/tests/run.sh b/tests/run.sh index ca4c2ca7f1..069df1d87d 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -27,9 +27,9 @@ replace_assertMatchesRegularExpression() { find='->assertMatchesRegularExpression(' replace='->assertRegExp(' if sed v < /dev/null 2> /dev/null; then - sed -i"" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* + sed -i"" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* else - sed -i "" -e"s/${find}/${replace}/" "./PHPCurlClass/PHP"* + sed -i "" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* fi } From ffda7c386a41272356e834a99b7327a84b0895fb Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 10 Jan 2025 17:47:54 -0500 Subject: [PATCH 16/23] Add PHPStan for static analysis (#905) --- .github/workflows/ci.yml | 8 ++++++-- composer.json | 1 + phpstan-baseline.neon | 13 +++++++++++++ phpstan.neon | 15 +++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 phpstan-baseline.neon create mode 100644 phpstan.neon diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ec098f84a..054da18b87 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,8 +46,12 @@ jobs: CI_PHP_VERSION: ${{ matrix.php-version }} CI_PHP_FUTURE_RELEASE: ${{ matrix.future-release }} - - name: Static analysis + - name: Static analysis - Psalm run: 'vendor/bin/psalm --config="tests/psalm.xml"' # TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm # supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107). - if: ${{ !matrix.future-release && matrix.php-version < 8.4 }} + if: ${{ matrix.php-version < 8.4 }} + + - name: Static analysis - PHPStan + run: 'vendor/bin/phpstan analyse --configuration="phpstan.neon" .' + if: ${{ matrix.php-version >= 7.4 }} diff --git a/composer.json b/composer.json index 89fb33a3e4..8eb824cf50 100644 --- a/composer.json +++ b/composer.json @@ -27,6 +27,7 @@ "friendsofphp/php-cs-fixer": "*", "phpcompatibility/php-compatibility": "dev-develop", "phpcsstandards/phpcsutils": "@alpha", + "phpstan/phpstan": "*", "phpunit/phpunit": "*", "squizlabs/php_codesniffer": "*" }, diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000000..812cdbbc7b --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,13 @@ +parameters: + ignoreErrors: + - + message: '#^Class CurlHandle not found\.$#' + identifier: class.notFound + count: 2 + path: src/Curl/Curl.php + + - + message: '#^Class CurlMultiHandle not found\.$#' + identifier: class.notFound + count: 2 + path: src/Curl/MultiCurl.php diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000000..e2cd26bd11 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,15 @@ +includes: + - phpstan-baseline.neon + +parameters: + reportUnmatchedIgnoredErrors: false + + # TODO: Increase rule level to be more strict. + level: 0 + + # TODO: Remove all exclusions except vendor/ and fix related errors. + excludePaths: + - examples/* + - tests/* + - vendor/* + - www/* From 55e95572fc2263890eeb2da4cfb16d419d7ee2e0 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 10 Jan 2025 18:35:10 -0500 Subject: [PATCH 17/23] Add flair to version bump pull requests (#906) --- .github/dependabot.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ff838cd55d..1de997ffa7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,12 +4,16 @@ updates: directory: "/" schedule: interval: "daily" + commit-message: + prefix: โฌ† versioning-strategy: "increase" - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" + commit-message: + prefix: โฌ† labels: - "cleanup-no-release-required" - "dependencies" @@ -19,4 +23,6 @@ updates: directory: "/" schedule: interval: "daily" + commit-message: + prefix: โฌ† versioning-strategy: "increase" From 87fc9b3796124d23f9076d908a86c0eda7910264 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 10 Jan 2025 21:44:05 -0500 Subject: [PATCH 18/23] Use separate scripts to ci tests (#907) * Run ci static analysis checks using scripts * Clean up * Move phpunit run to dedicated script * Use run.sh and remove ci.sh * Rename test scripts to be prefixed with "run_" * Move static analysis runs to test script * Clean up --- .github/workflows/ci.yml | 12 +- TESTING.md | 2 +- tests/check_static_analysis.sh | 11 -- tests/display_errors.inc.sh | 11 ++ tests/run.sh | 150 +++--------------- ...dards.sh => run_coding_standards_check.sh} | 8 +- tests/{ci.sh => run_phpunit.sh} | 54 +------ tests/run_static_analysis_check_phpstan.sh | 23 +++ tests/run_static_analysis_check_psalm.sh | 25 +++ .../{check_syntax.sh => run_syntax_check.sh} | 9 +- tests/set_vars.inc.sh | 4 + tests/skip_slow_tests.sh | 2 + tests/test_all.sh | 2 + 13 files changed, 110 insertions(+), 203 deletions(-) delete mode 100755 tests/check_static_analysis.sh create mode 100644 tests/display_errors.inc.sh rename tests/{check_coding_standards.sh => run_coding_standards_check.sh} (98%) rename tests/{ci.sh => run_phpunit.sh} (68%) create mode 100755 tests/run_static_analysis_check_phpstan.sh create mode 100755 tests/run_static_analysis_check_psalm.sh rename tests/{check_syntax.sh => run_syntax_check.sh} (66%) create mode 100644 tests/set_vars.inc.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 054da18b87..8c4b3522e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,17 +41,7 @@ jobs: persist-credentials: false - name: Test - run: bash tests/ci.sh + run: bash tests/run.sh env: CI_PHP_VERSION: ${{ matrix.php-version }} CI_PHP_FUTURE_RELEASE: ${{ matrix.future-release }} - - - name: Static analysis - Psalm - run: 'vendor/bin/psalm --config="tests/psalm.xml"' - # TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm - # supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107). - if: ${{ matrix.php-version < 8.4 }} - - - name: Static analysis - PHPStan - run: 'vendor/bin/phpstan analyse --configuration="phpstan.neon" .' - if: ${{ matrix.php-version >= 7.4 }} diff --git a/TESTING.md b/TESTING.md index 2516486bb3..aeaf8f627a 100644 --- a/TESTING.md +++ b/TESTING.md @@ -30,4 +30,4 @@ cd php-curl-class/ ### Continuous Integration Tests -Continuous integration runs [tests/ci.sh](https://github.com/php-curl-class/php-curl-class/blob/master/tests/ci.sh) on supported PHP versions and is configured with [.github/workflows/ci.yml](https://github.com/php-curl-class/php-curl-class/blob/master/.github/workflows/ci.yml). +Continuous integration runs [tests/run.sh](https://github.com/php-curl-class/php-curl-class/blob/master/tests/run.sh) on supported PHP versions and is configured with [.github/workflows/ci.yml](https://github.com/php-curl-class/php-curl-class/blob/master/.github/workflows/ci.yml). diff --git a/tests/check_static_analysis.sh b/tests/check_static_analysis.sh deleted file mode 100755 index 2b1198fc52..0000000000 --- a/tests/check_static_analysis.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "${SCRIPT_DIR}" - -# Run commands from the project root directory. -cd .. - -set -x - -vendor/bin/psalm --config="tests/psalm.xml" diff --git a/tests/display_errors.inc.sh b/tests/display_errors.inc.sh new file mode 100644 index 0000000000..3ae4ce73c5 --- /dev/null +++ b/tests/display_errors.inc.sh @@ -0,0 +1,11 @@ +error_count="${#errors[@]}" +if [[ "${error_count}" -ge 1 ]]; then + echo -e "\nErrors found: ${error_count}" + + iter=0 + for value in "${errors[@]}"; do + ((iter++)) + echo -e "\nError ${iter} of ${error_count}:" + echo "${value}" | perl -pe 's/^(.*)$/\t\1/' + done +fi diff --git a/tests/run.sh b/tests/run.sh index 069df1d87d..9b98225765 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,63 +1,25 @@ #!/usr/bin/env bash -remove_expectWarning() { - # Fix "Call to undefined method CurlTest\CurlTest::expectWarning()". - if sed v < /dev/null 2> /dev/null; then - sed -i"" -e "/->expectWarning(/d" "./PHPCurlClass/PHP"* - else - sed -i "" -e "/->expectWarning(/d" "./PHPCurlClass/PHP"* - fi -} - -replace_assertStringContainsString() { - # -->assertStringContainsString( - # +->assertContains( - find='->assertStringContainsString(' - replace='->assertContains(' - if sed v < /dev/null 2> /dev/null; then - sed -i"" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* - else - sed -i "" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* - fi -} - -replace_assertMatchesRegularExpression() { - # -->assertMatchesRegularExpression( - # +->assertRegExp( - find='->assertMatchesRegularExpression(' - replace='->assertRegExp(' - if sed v < /dev/null 2> /dev/null; then - sed -i"" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* - else - sed -i "" -e "s/${find}/${replace}/" "./PHPCurlClass/PHP"* - fi -} - -phpunit_v6_5_shim() { - remove_expectWarning - replace_assertMatchesRegularExpression - replace_assertStringContainsString -} - -phpunit_v7_5_shim() { - remove_expectWarning - replace_assertMatchesRegularExpression -} - -phpunit_v8_5_shim() { - remove_expectWarning - replace_assertMatchesRegularExpression -} +set -x -phpunit_v9_shim() { - replace_assertMatchesRegularExpression -} +if [[ "${CI}" == "true" ]]; then + composer self-update + + # TODO: Add "vimeo/psalm" back into composer.json under "require-dev" when + # vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): + # "require-dev": { + # "vimeo/psalm": ">=5.26.1" + # }, + # + # TODO: Remove this workaround that only installs vimeo/psalm on PHP < 8.4 when + # vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): + if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then + composer require --dev "vimeo/psalm:>=5.26.1" + fi -phpunit_v10_shim() { - remove_expectWarning -} + composer install --prefer-source --no-interaction +fi -set -x # Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable. export PATH="${PWD}/vendor/bin:${PATH}" @@ -65,88 +27,26 @@ export PATH="${PWD}/vendor/bin:${PATH}" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" +source "set_vars.inc.sh" + echo "CI_PHP_VERSION: ${CI_PHP_VERSION}" echo "CI_PHP_FUTURE_RELEASE: ${CI_PHP_FUTURE_RELEASE}" php -r "var_dump(phpversion());" php -r "var_dump(curl_version());" -# Let test server know we should allow testing. -export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" - -# Start test servers. Run servers on different ports to allow simultaneous -# requests without blocking. -server_count=7 -declare -A pids -for i in $(seq 0 $(("${server_count}" - 1))); do - port=8000 - (( port += $i )) - - php -S "127.0.0.1:${port}" server.php &> /dev/null & - pids["${i}"]="${!}" -done - errors=() -source "check_syntax.sh" - -# Determine which phpunit to use. -if [[ -f "../vendor/bin/phpunit" ]]; then - phpunit_to_use="../vendor/bin/phpunit" -else - phpunit_to_use="phpunit" -fi - -phpunit_version="$("${phpunit_to_use}" --version | grep -Eo "[0-9]+\.[0-9]+\.[0-9]+")" -echo "phpunit_version: ${phpunit_version}" - -extra_args="${@}" -if [[ "${phpunit_version}" == "6.5."* ]]; then - phpunit_v6_5_shim - phpunit_args=" --debug --verbose --fail-on-risky ${extra_args}" -elif [[ "${phpunit_version}" == "7.5."* ]]; then - phpunit_v7_5_shim - phpunit_args=" --debug --verbose --fail-on-risky ${extra_args}" -elif [[ "${phpunit_version}" == "8.5."* ]]; then - phpunit_v8_5_shim - phpunit_args=" --debug --verbose --fail-on-risky ${extra_args}" -elif [[ "${phpunit_version}" == "9."* ]]; then - phpunit_v9_shim - phpunit_args=" --debug --verbose --fail-on-risky ${extra_args}" -elif [[ "${phpunit_version}" == "10."* ]]; then - phpunit_v10_shim - phpunit_args=" --display-incomplete --display-skipped --display-deprecations --display-errors --display-notices --display-warnings --fail-on-risky ${extra_args}" -fi +source "run_syntax_check.sh" -# Run tests. -"${phpunit_to_use}" --version -"${phpunit_to_use}" \ - --configuration "phpunit.xml" \ - ${phpunit_args} -if [[ "${?}" -ne 0 ]]; then - echo "Error: phpunit command failed" - errors+=("phpunit command failed") -fi +source "run_coding_standards_check.sh" -source "check_coding_standards.sh" +source "run_phpunit.sh" -set +x +source "run_static_analysis_check_phpstan.sh" -error_count="${#errors[@]}" -if [[ "${error_count}" -ge 1 ]]; then - echo -e "\nErrors found: ${error_count}" - - iter=0 - for value in "${errors[@]}"; do - ((iter++)) - echo -e "\nError ${iter} of ${error_count}:" - echo "${value}" | perl -pe 's/^(.*)$/\t\1/' - done -fi +source "run_static_analysis_check_psalm.sh" -# Stop test servers. -for pid in "${pids[@]}"; do - kill "${pid}" &> /dev/null & -done +source "display_errors.inc.sh" if [[ "${CI_PHP_FUTURE_RELEASE}" != "true" ]]; then exit "${#errors[@]}" diff --git a/tests/check_coding_standards.sh b/tests/run_coding_standards_check.sh similarity index 98% rename from tests/check_coding_standards.sh rename to tests/run_coding_standards_check.sh index 6c45a848f5..f3f76f1197 100755 --- a/tests/check_coding_standards.sh +++ b/tests/run_coding_standards_check.sh @@ -1,8 +1,12 @@ +#!/usr/bin/env bash + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" +source "set_vars.inc.sh" + # Run commands from the project root directory. -cd .. +pushd .. # Enforce line ending consistency in php files. crlf_file=$(find . -type "f" -iname "*.php" ! -path "*/vendor/*" -exec grep --color=always --files-with-matches $'\r' {} \;) @@ -128,3 +132,5 @@ if [[ "${?}" -ne 0 ]]; then fi fi + +popd diff --git a/tests/ci.sh b/tests/run_phpunit.sh similarity index 68% rename from tests/ci.sh rename to tests/run_phpunit.sh index ccdaefc09e..01b8bd2b7d 100755 --- a/tests/ci.sh +++ b/tests/run_phpunit.sh @@ -57,35 +57,9 @@ phpunit_v10_shim() { remove_expectWarning } -set -x - -composer self-update - -# TODO: Add "vimeo/psalm" back into composer.json under "require-dev" when -# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): -# "require-dev": { -# "vimeo/psalm": ">=5.26.1" -# }, -# -# TODO: Remove this workaround that only installs vimeo/psalm on PHP < 8.4 when -# vimeo/psalm supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107): -if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then - composer require --dev "vimeo/psalm:>=5.26.1" -fi - -composer install --prefer-source --no-interaction - -# Use composer's phpunit and phpcs by adding composer bin directory to the path environment variable. -export PATH="${PWD}/vendor/bin:${PATH}" - SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" -echo "CI_PHP_VERSION: ${CI_PHP_VERSION}" -echo "CI_PHP_FUTURE_RELEASE: ${CI_PHP_FUTURE_RELEASE}" -php -r "var_dump(phpversion());" -php -r "var_dump(curl_version());" - # Let test server know we should allow testing. export PHP_CURL_CLASS_TEST_MODE_ENABLED="yes" @@ -101,10 +75,6 @@ for i in $(seq 0 $(("${server_count}" - 1))); do pids["${i}"]="${!}" done -errors=() - -source "check_syntax.sh" - # Determine which phpunit to use. if [[ -f "../vendor/bin/phpunit" ]]; then phpunit_to_use="../vendor/bin/phpunit" @@ -143,29 +113,7 @@ if [[ "${?}" -ne 0 ]]; then errors+=("phpunit command failed") fi -source "check_coding_standards.sh" - -set +x - -error_count="${#errors[@]}" -if [[ "${error_count}" -ge 1 ]]; then - echo -e "\nErrors found: ${error_count}" - - iter=0 - for value in "${errors[@]}"; do - ((iter++)) - echo -e "\nError ${iter} of ${error_count}:" - echo "${value}" | perl -pe 's/^(.*)$/\t\1/' - done -fi - # Stop test servers. for pid in "${pids[@]}"; do - kill "${pid}" &> /dev/null & + kill "${pid}" &> /dev/null & done - -if [[ "${CI_PHP_FUTURE_RELEASE}" != "true" ]]; then - exit "${#errors[@]}" -elif [[ "${#errors[@]}" -ne 0 ]]; then - echo "One or more tests failed, but allowed as the CI_PHP_FUTURE_RELEASE flag is on for PHP version ${CI_PHP_VERSION}." -fi diff --git a/tests/run_static_analysis_check_phpstan.sh b/tests/run_static_analysis_check_phpstan.sh new file mode 100755 index 0000000000..0bb837f469 --- /dev/null +++ b/tests/run_static_analysis_check_phpstan.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "${SCRIPT_DIR}" + +source "set_vars.inc.sh" + +# Run commands from the project root directory. +pushd .. + +set -x + +if [[ $(echo "${CI_PHP_VERSION} >= 7.4" | bc -l) -eq 1 ]]; then + vendor/bin/phpstan analyse --configuration="phpstan.neon" . + if [[ "${?}" -ne 0 ]]; then + echo "Error: phpstan static analysis check failed" + errors+=("phpstan static analysis check failed") + fi +else + echo "Skipped running phpstan check" +fi + +popd diff --git a/tests/run_static_analysis_check_psalm.sh b/tests/run_static_analysis_check_psalm.sh new file mode 100755 index 0000000000..9cfae37163 --- /dev/null +++ b/tests/run_static_analysis_check_psalm.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +cd "${SCRIPT_DIR}" + +source "set_vars.inc.sh" + +# Run commands from the project root directory. +pushd .. + +set -x + +# TODO: Remove exclusion that skips running psalm on PHP 8.4 when psalm +# supports PHP 8.4 (https://github.com/vimeo/psalm/issues/11107). +if [[ $(echo "${CI_PHP_VERSION} < 8.4" | bc -l) -eq 1 ]]; then + vendor/bin/psalm --config="tests/psalm.xml" + if [[ "${?}" -ne 0 ]]; then + echo "Error: psalm static analysis check failed" + errors+=("psalm static analysis check failed") + fi +else + echo "Skipped running psalm check" +fi + +popd diff --git a/tests/check_syntax.sh b/tests/run_syntax_check.sh similarity index 66% rename from tests/check_syntax.sh rename to tests/run_syntax_check.sh index 223cb522f4..ae0b8cc409 100755 --- a/tests/check_syntax.sh +++ b/tests/run_syntax_check.sh @@ -1,9 +1,16 @@ +#!/usr/bin/env bash + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" +# Run commands from the project root directory. +pushd .. + # Check syntax in php files. Use `xargs' over `find -exec' as xargs exits with a value of 1 when any command errors. -find .. -type "f" -iname "*.php" ! -path "*/vendor/*" | xargs -L "1" php -l +find . -type "f" -iname "*.php" ! -path "*/vendor/*" | xargs -L "1" php -l if [[ "${?}" -ne 0 ]]; then echo "Error: php syntax checks failed" errors+=("php syntax checks failed") fi + +popd diff --git a/tests/set_vars.inc.sh b/tests/set_vars.inc.sh new file mode 100644 index 0000000000..dc33f7b01e --- /dev/null +++ b/tests/set_vars.inc.sh @@ -0,0 +1,4 @@ +# Use installed version when variable not set. +if [[ -z "${CI_PHP_VERSION}" ]]; then + CI_PHP_VERSION="$(php -r "echo preg_replace('/^([0-9]+\.[0-9]+)\.[0-9]+/', '\$1', phpversion());")" +fi diff --git a/tests/skip_slow_tests.sh b/tests/skip_slow_tests.sh index 59b4b9b935..9ba74745ee 100755 --- a/tests/skip_slow_tests.sh +++ b/tests/skip_slow_tests.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" diff --git a/tests/test_all.sh b/tests/test_all.sh index 11b09b3512..118e747ecc 100755 --- a/tests/test_all.sh +++ b/tests/test_all.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "${SCRIPT_DIR}" From 634ee48552ab7f3c5e3a17926c68dda01853772f Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 11 Jan 2025 21:51:30 -0500 Subject: [PATCH 19/23] Increase PHPStan strictness (#908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enable color * Increase PHPStan strictness * Fix static analysis error ------ -------------------------------------------------- Line src/Curl/MultiCurl.php ------ -------------------------------------------------- 593 Variable $interval_seconds might not be defined. ๐Ÿชช variable.undefined ------ -------------------------------------------------- * Increase PHPStan strictness * Fix static analysis errors ------ ----------------------------------------------------------------- Line scripts/bump_major_version.php ------ ----------------------------------------------------------------- 8 Binary operation "+=" between string and 1 results in an error. ๐Ÿชช assignOp.invalid ------ ----------------------------------------------------------------- ------ ----------------------------------------------------------------- Line scripts/bump_minor_version.php ------ ----------------------------------------------------------------- 8 Binary operation "+=" between string and 1 results in an error. ๐Ÿชช assignOp.invalid ------ ----------------------------------------------------------------- ------ ----------------------------------------------------------------- Line scripts/bump_patch_version.php ------ ----------------------------------------------------------------- 8 Binary operation "+=" between string and 1 results in an error. ๐Ÿชช assignOp.invalid ------ ----------------------------------------------------------------- * Fix static analysis errors ------ -------------------------------------------------------------------------------------------------------------------- Line src/Curl/CaseInsensitiveArray.php ------ -------------------------------------------------------------------------------------------------------------------- 132 PHPDoc tag @param has invalid value (void): Unexpected token "\n * ", expected variable at offset 42 on line 4 ๐Ÿชช phpDoc.parseError 145 PHPDoc tag @param has invalid value (void): Unexpected token "\n * ", expected variable at offset 44 on line 4 ๐Ÿชช phpDoc.parseError 158 PHPDoc tag @param has invalid value (void): Unexpected token "\n * ", expected variable at offset 41 on line 4 ๐Ÿชช phpDoc.parseError 171 PHPDoc tag @param has invalid value (void): Unexpected token "\n * ", expected variable at offset 40 on line 4 ๐Ÿชช phpDoc.parseError 197 PHPDoc tag @param has invalid value (void): Unexpected token "\n * ", expected variable at offset 43 on line 4 ๐Ÿชช phpDoc.parseError ------ -------------------------------------------------------------------------------------------------------------------- * Fix static analysis errors ------ ----------------------------------------------------------------------------------- Line src/Curl/MultiCurl.php ------ ----------------------------------------------------------------------------------- 937 Comparison operation "<" between float and (array|float|int) results in an error. ๐Ÿชช smaller.invalid 941 Comparison operation "<" between float and (array|float|int) results in an error. ๐Ÿชช smaller.invalid ------ ----------------------------------------------------------------------------------- * Increase PHPStan strictness * Fix static analysis errors ------ ------------------------------------------- Line src/Curl/Decoder.php ------ ------------------------------------------- 22 Offset '0' does not exist on list. ๐Ÿชช offsetAccess.notFound 41 Offset '0' does not exist on list. ๐Ÿชช offsetAccess.notFound ------ ------------------------------------------- --- phpstan.neon | 2 +- scripts/bump_major_version.php | 2 +- scripts/bump_minor_version.php | 2 +- scripts/bump_patch_version.php | 2 +- src/Curl/CaseInsensitiveArray.php | 5 ----- src/Curl/Decoder.php | 4 ++-- src/Curl/MultiCurl.php | 3 ++- tests/run_static_analysis_check_phpstan.sh | 2 +- 8 files changed, 9 insertions(+), 13 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index e2cd26bd11..3027197f8a 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,7 +5,7 @@ parameters: reportUnmatchedIgnoredErrors: false # TODO: Increase rule level to be more strict. - level: 0 + level: 3 # TODO: Remove all exclusions except vendor/ and fix related errors. excludePaths: diff --git a/scripts/bump_major_version.php b/scripts/bump_major_version.php index 7ca2f6c2c5..77b03069a4 100755 --- a/scripts/bump_major_version.php +++ b/scripts/bump_major_version.php @@ -5,7 +5,7 @@ $current_version = Curl\Curl::VERSION; list($major, $_, $__) = explode('.', $current_version); -$new_version = implode('.', [(string)((int)$major += 1), '0', '0']); +$new_version = implode('.', [(string)((int)$major + 1), '0', '0']); foreach ( [ diff --git a/scripts/bump_minor_version.php b/scripts/bump_minor_version.php index a960450689..0de25185e0 100755 --- a/scripts/bump_minor_version.php +++ b/scripts/bump_minor_version.php @@ -5,7 +5,7 @@ $current_version = Curl\Curl::VERSION; list($major, $minor, $_) = explode('.', $current_version); -$new_version = implode('.', [$major, (string)((int)$minor += 1), '0']); +$new_version = implode('.', [$major, (string)((int)$minor + 1), '0']); foreach ( [ diff --git a/scripts/bump_patch_version.php b/scripts/bump_patch_version.php index df57314295..0b6804ae3a 100755 --- a/scripts/bump_patch_version.php +++ b/scripts/bump_patch_version.php @@ -5,7 +5,7 @@ $current_version = Curl\Curl::VERSION; list($major, $minor, $patch) = explode('.', $current_version); -$new_version = implode('.', [$major, $minor, (string)((int)$patch += 1)]); +$new_version = implode('.', [$major, $minor, (string)((int)$patch + 1)]); foreach ( [ diff --git a/src/Curl/CaseInsensitiveArray.php b/src/Curl/CaseInsensitiveArray.php index e12901775e..f8b6515957 100644 --- a/src/Curl/CaseInsensitiveArray.php +++ b/src/Curl/CaseInsensitiveArray.php @@ -129,7 +129,6 @@ public function offsetGet($offset) /** * Count * - * @param void * @return int The number of elements stored in the array. * @see https://secure.php.net/manual/en/countable.count.php */ @@ -142,7 +141,6 @@ public function count() /** * Current * - * @param void * @return mixed Data at the current position. * @see https://secure.php.net/manual/en/iterator.current.php */ @@ -155,7 +153,6 @@ public function current() /** * Next * - * @param void * @return void * @see https://secure.php.net/manual/en/iterator.next.php */ @@ -168,7 +165,6 @@ public function next() /** * Key * - * @param void * @return mixed Case-sensitive key at current position. * @see https://secure.php.net/manual/en/iterator.key.php */ @@ -194,7 +190,6 @@ public function valid() /** * Rewind * - * @param void * @return void * @see https://secure.php.net/manual/en/iterator.rewind.php */ diff --git a/src/Curl/Decoder.php b/src/Curl/Decoder.php index 5f9821973a..b2aa0417db 100644 --- a/src/Curl/Decoder.php +++ b/src/Curl/Decoder.php @@ -18,7 +18,7 @@ public static function decodeJson() { $args = func_get_args(); $response = call_user_func_array('json_decode', $args); - if ($response === null) { + if ($response === null && isset($args['0'])) { $response = $args['0']; } return $response; @@ -37,7 +37,7 @@ public static function decodeXml() { $args = func_get_args(); $response = @call_user_func_array('simplexml_load_string', $args); - if ($response === false) { + if ($response === false && array_key_exists('0', $args)) { $response = $args['0']; } return $response; diff --git a/src/Curl/MultiCurl.php b/src/Curl/MultiCurl.php index 5f3d9f617c..f6c00a8c86 100644 --- a/src/Curl/MultiCurl.php +++ b/src/Curl/MultiCurl.php @@ -578,6 +578,7 @@ public function setRateLimit($rate_limit) $unit = strtolower($matches['3']); // Convert interval to seconds based on unit. + $interval_seconds = ''; if ($unit === 's') { $interval_seconds = $interval * 1; } elseif ($unit === 'm') { @@ -925,7 +926,7 @@ private function hasRequestQuota() */ private function waitUntilRequestQuotaAvailable() { - $sleep_until = $this->currentStartTime + $this->intervalSeconds; + $sleep_until = (float)($this->currentStartTime + $this->intervalSeconds); $sleep_seconds = $sleep_until - microtime(true); // Avoid using time_sleep_until() as it appears to be less precise and not sleep long enough. diff --git a/tests/run_static_analysis_check_phpstan.sh b/tests/run_static_analysis_check_phpstan.sh index 0bb837f469..08a7406d0e 100755 --- a/tests/run_static_analysis_check_phpstan.sh +++ b/tests/run_static_analysis_check_phpstan.sh @@ -11,7 +11,7 @@ pushd .. set -x if [[ $(echo "${CI_PHP_VERSION} >= 7.4" | bc -l) -eq 1 ]]; then - vendor/bin/phpstan analyse --configuration="phpstan.neon" . + vendor/bin/phpstan analyse --ansi --configuration="phpstan.neon" . if [[ "${?}" -ne 0 ]]; then echo "Error: phpstan static analysis check failed" errors+=("phpstan static analysis check failed") From bd793d128745db1e0d131c7fc204434fa72af9d7 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sat, 11 Jan 2025 23:11:26 -0500 Subject: [PATCH 20/23] Increase Psalm strictness (#909) * Increase Psalm strictness * Fix static analysis errors ERROR: RedundantCast - ../src/Curl/CaseInsensitiveArray.php:91:16 - Redundant cast to bool (see https://psalm.dev/262) return (bool) array_key_exists(strtolower($offset), $this->data); ERROR: RedundantCast - ../src/Curl/CaseInsensitiveArray.php:138:16 - Redundant cast to int<0, max> (see https://psalm.dev/262) return (int) count($this->data); ERROR: RedundantCast - ../src/Curl/CaseInsensitiveArray.php:187:16 - Redundant cast to bool (see https://psalm.dev/262) return (bool) (key($this->data) !== null); ERROR: ForbiddenCode - ../src/Curl/Curl.php:1765:13 - Unsafe var_dump (see https://psalm.dev/002) var_dump($value); ERROR: ForbiddenCode - ../src/Curl/Curl.php:1770:13 - Unsafe var_dump (see https://psalm.dev/002) var_dump($value); ERROR: InvalidOperand - ../src/Curl/Curl.php:1816:35 - Cannot concatenate with a value-of (see https://psalm.dev/058) return $k . '=' . $v; --- src/Curl/CaseInsensitiveArray.php | 6 +++--- src/Curl/Curl.php | 8 +++++--- tests/psalm-baseline.xml | 9 +++++++++ tests/psalm.xml | 4 +++- 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 tests/psalm-baseline.xml diff --git a/src/Curl/CaseInsensitiveArray.php b/src/Curl/CaseInsensitiveArray.php index f8b6515957..72b757a7e7 100644 --- a/src/Curl/CaseInsensitiveArray.php +++ b/src/Curl/CaseInsensitiveArray.php @@ -88,7 +88,7 @@ public function offsetSet($offset, $value) #[\ReturnTypeWillChange] public function offsetExists($offset) { - return (bool) array_key_exists(strtolower($offset), $this->data); + return array_key_exists(strtolower($offset), $this->data); } /** @@ -135,7 +135,7 @@ public function offsetGet($offset) #[\ReturnTypeWillChange] public function count() { - return (int) count($this->data); + return count($this->data); } /** @@ -184,7 +184,7 @@ public function key() #[\ReturnTypeWillChange] public function valid() { - return (bool) (key($this->data) !== null); + return (key($this->data) !== null); } /** diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index 739177c214..dd4177fc19 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -1812,9 +1812,11 @@ private function buildCookies() if (count($this->cookies)) { // Avoid using http_build_query() as unnecessary encoding is performed. // http_build_query($this->cookies, '', '; '); - $this->setOpt(CURLOPT_COOKIE, implode('; ', array_map(function ($k, $v) { - return $k . '=' . $v; - }, array_keys($this->cookies), array_values($this->cookies)))); + $cookies = []; + foreach ($this->cookies as $key => $value) { + $cookies[] = $key . '=' . $value; + } + $this->setOpt(CURLOPT_COOKIE, implode('; ', $cookies)); } } diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml new file mode 100644 index 0000000000..867a21c21d --- /dev/null +++ b/tests/psalm-baseline.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/tests/psalm.xml b/tests/psalm.xml index 79b8a77f32..d56152c69a 100644 --- a/tests/psalm.xml +++ b/tests/psalm.xml @@ -1,10 +1,12 @@ + From 29cca2e48bcf1186f44616721945b791768de595 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sun, 12 Jan 2025 12:39:31 -0500 Subject: [PATCH 21/23] Move some configs out of the root directory (#910) * Move flake8 configuration out of root directory * Move PHPStan configuration out of root directory --- .github/workflows/lint.yml | 2 +- .pre-commit-config.yaml | 1 + phpstan-baseline.neon => tests/phpstan-baseline.neon | 4 ++-- phpstan.neon => tests/phpstan.neon | 8 ++++---- tests/run_static_analysis_check_phpstan.sh | 2 +- setup.cfg => tests/setup.cfg | 0 6 files changed, 9 insertions(+), 8 deletions(-) rename phpstan-baseline.neon => tests/phpstan-baseline.neon (77%) rename phpstan.neon => tests/phpstan.neon (74%) rename setup.cfg => tests/setup.cfg (100%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 048143a3d0..cf77ee245f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,7 +30,7 @@ jobs: - name: flake8 changed files if: steps.changed-files.outputs.any_changed == 'true' run: | - flake8 ${{ steps.changed-files.outputs.all_changed_files }} + flake8 --config="tests/setup.cfg" ${{ steps.changed-files.outputs.all_changed_files }} - name: isort changed files if: steps.changed-files.outputs.any_changed == 'true' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 726d8f3b15..25906bc1a6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,6 +21,7 @@ repos: rev: 7.1.1 hooks: - id: flake8 + args: ["--config", "tests/setup.cfg"] - repo: https://github.com/pycqa/isort rev: 5.13.2 hooks: diff --git a/phpstan-baseline.neon b/tests/phpstan-baseline.neon similarity index 77% rename from phpstan-baseline.neon rename to tests/phpstan-baseline.neon index 812cdbbc7b..cde552e0fc 100644 --- a/phpstan-baseline.neon +++ b/tests/phpstan-baseline.neon @@ -4,10 +4,10 @@ parameters: message: '#^Class CurlHandle not found\.$#' identifier: class.notFound count: 2 - path: src/Curl/Curl.php + path: ../src/Curl/Curl.php - message: '#^Class CurlMultiHandle not found\.$#' identifier: class.notFound count: 2 - path: src/Curl/MultiCurl.php + path: ../src/Curl/MultiCurl.php diff --git a/phpstan.neon b/tests/phpstan.neon similarity index 74% rename from phpstan.neon rename to tests/phpstan.neon index 3027197f8a..dafd9478e0 100644 --- a/phpstan.neon +++ b/tests/phpstan.neon @@ -9,7 +9,7 @@ parameters: # TODO: Remove all exclusions except vendor/ and fix related errors. excludePaths: - - examples/* - - tests/* - - vendor/* - - www/* + - ../examples/* + - ../tests/* + - ../vendor/* + - ../www/* diff --git a/tests/run_static_analysis_check_phpstan.sh b/tests/run_static_analysis_check_phpstan.sh index 08a7406d0e..59121951af 100755 --- a/tests/run_static_analysis_check_phpstan.sh +++ b/tests/run_static_analysis_check_phpstan.sh @@ -11,7 +11,7 @@ pushd .. set -x if [[ $(echo "${CI_PHP_VERSION} >= 7.4" | bc -l) -eq 1 ]]; then - vendor/bin/phpstan analyse --ansi --configuration="phpstan.neon" . + vendor/bin/phpstan analyse --ansi --configuration="tests/phpstan.neon" . if [[ "${?}" -ne 0 ]]; then echo "Error: phpstan static analysis check failed" errors+=("phpstan static analysis check failed") diff --git a/setup.cfg b/tests/setup.cfg similarity index 100% rename from setup.cfg rename to tests/setup.cfg From 8cbaf60cf0ff3bac0b3d5d0d8e6e244f7b8e709f Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Sun, 12 Jan 2025 15:59:05 -0500 Subject: [PATCH 22/23] Move pre-commit configuration out of root directory (#911) --- .gitattributes | 1 - .github/workflows/pre-commit-auto-update.yml | 2 +- .pre-commit-config.yaml => tests/.pre-commit-config.yaml | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) rename .pre-commit-config.yaml => tests/.pre-commit-config.yaml (88%) diff --git a/.gitattributes b/.gitattributes index aece42002b..66460898b5 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,6 +7,5 @@ /.editorconfig export-ignore /.gitattributes export-ignore /.gitignore export-ignore -/.pre-commit-config.yaml export-ignore /TESTING.md export-ignore /TROUBLESHOOTING.md export-ignore diff --git a/.github/workflows/pre-commit-auto-update.yml b/.github/workflows/pre-commit-auto-update.yml index cf9d376277..726704f501 100644 --- a/.github/workflows/pre-commit-auto-update.yml +++ b/.github/workflows/pre-commit-auto-update.yml @@ -20,7 +20,7 @@ jobs: set -x python -m pip install --upgrade pip pip install pre-commit - pre-commit autoupdate + pre-commit autoupdate --config="tests/.pre-commit-config.yaml" - name: Gather changes id: gather-changes diff --git a/.pre-commit-config.yaml b/tests/.pre-commit-config.yaml similarity index 88% rename from .pre-commit-config.yaml rename to tests/.pre-commit-config.yaml index 25906bc1a6..c177426968 100644 --- a/.pre-commit-config.yaml +++ b/tests/.pre-commit-config.yaml @@ -6,10 +6,10 @@ # $ brew install pre-commit # # 2. Install hooks -# $ pre-commit install +# $ pre-commit install --config="tests/.pre-commit-config.yaml" # # 3. Optionally, enable automatic updates -# $ pre-commit autoupdate +# $ pre-commit autoupdate --config="tests/.pre-commit-config.yaml" repos: - repo: https://github.com/psf/black rev: 24.10.0 From c8a7bc92f2337e634611eb127b5d269a243d2034 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 18:04:13 +0000 Subject: [PATCH 23/23] =?UTF-8?q?Bump=20version:=2011.0.0=20=E2=86=92=2011?= =?UTF-8?q?.0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ src/Curl/Curl.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d148c534..7674b80db2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ backwards-incompatible changes that will affect existing usage. +## 11.0.1 - 2025-01-13 + +- Increase Psalm strictness ([#909](https://github.com/php-curl-class/php-curl-class/pull/909)) +- Increase PHPStan strictness ([#908](https://github.com/php-curl-class/php-curl-class/pull/908)) + ## 11.0.0 - 2024-08-22 - Drop support for PHP 7.3 ([#889](https://github.com/php-curl-class/php-curl-class/pull/889)) diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php index dd4177fc19..d71118f1c9 100644 --- a/src/Curl/Curl.php +++ b/src/Curl/Curl.php @@ -6,7 +6,7 @@ class Curl extends BaseCurl { - public const VERSION = '11.0.0'; + public const VERSION = '11.0.1'; public const DEFAULT_TIMEOUT = 30; public $curl = null;