From 468eb1e8d1a414e7854cbf489dbc8bc592771d19 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 27 Nov 2025 15:32:46 +0300 Subject: [PATCH 1/6] PHP 8.5 support --- .github/workflows/build.yml | 2 +- .../workflows/composer-require-checker.yml | 2 +- .github/workflows/mutation.yml | 5 +++-- .github/workflows/rector.yml | 2 +- CHANGELOG.md | 2 +- README.md | 2 +- composer.json | 22 ++++++++++++------- tools/.gitignore | 2 ++ tools/infection/composer.json | 10 +++++++++ tools/psalm/composer.json | 5 +++++ 10 files changed, 39 insertions(+), 15 deletions(-) create mode 100644 tools/.gitignore create mode 100644 tools/infection/composer.json create mode 100644 tools/psalm/composer.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4fb81da..f30002e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest', 'windows-latest'] php: >- - ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml index d864b99..57379c0 100644 --- a/.github/workflows/composer-require-checker.yml +++ b/.github/workflows/composer-require-checker.yml @@ -31,4 +31,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/.github/workflows/mutation.yml b/.github/workflows/mutation.yml index 8150499..cc40daa 100644 --- a/.github/workflows/mutation.yml +++ b/.github/workflows/mutation.yml @@ -22,11 +22,12 @@ name: mutation test jobs: mutation: - uses: yiisoft/actions/.github/workflows/roave-infection.yml@master + uses: yiisoft/actions/.github/workflows/infection.yml@master with: os: >- ['ubuntu-latest'] php: >- - ['8.2'] + ['8.5'] + infection-args: "--ignore-msi-with-no-mutations" secrets: STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }} diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 5d6931d..20f7d89 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -21,4 +21,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.4'] + ['8.5'] diff --git a/CHANGELOG.md b/CHANGELOG.md index 5edd390..1b950a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.2.1 under development -- Chg #68: Change PHP constraint in `composer.json` to `7.4.* || 8.0 - 8.4` (@vjik) +- Chg #68: Change PHP constraint in `composer.json` to `7.4.* || 8.0 - 8.5` (@vjik) ## 1.2.0 September 02, 2024 diff --git a/README.md b/README.md index d10f58d..3cfd2a4 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ The package contains various network utilities useful for: ## Requirements -- PHP 7.4 or higher. +- PHP 7.4 - 8.5. ## Installation diff --git a/composer.json b/composer.json index 6fd3faa..b365f18 100644 --- a/composer.json +++ b/composer.json @@ -29,15 +29,14 @@ } ], "require": { - "php": "7.4.* || 8.0 - 8.4" + "php": "7.4.* || 8.0 - 8.5" }, "require-dev": { - "maglnet/composer-require-checker": "^3.8 || ^4.4", - "phpunit/phpunit": "^9.6.22", - "rector/rector": "^2.0.10", - "roave/infection-static-analysis-plugin": "^1.18", - "spatie/phpunit-watcher": "^1.23.6", - "vimeo/psalm": "^4.30 || ^5.26.1 || ^6.8.8" + "bamarni/composer-bin-plugin": "^1.8.3", + "maglnet/composer-require-checker": "^3.8 || ^4.17", + "phpunit/phpunit": "^9.6.29", + "rector/rector": "^2.2.8", + "spatie/phpunit-watcher": "^1.24.0" }, "autoload": { "psr-4": { @@ -53,11 +52,18 @@ "test": "phpunit --testdox --no-interaction", "test-watch": "phpunit-watcher watch" }, + "extra": { + "bamarni-bin": { + "bin-links": true, + "target-directory": "tools", + "forward-command": true + } + }, "config": { "sort-packages": true, "bump-after-update": "dev", "allow-plugins": { - "infection/extension-installer": true, + "bamarni/composer-bin-plugin": true, "composer/package-versions-deprecated": true } } diff --git a/tools/.gitignore b/tools/.gitignore new file mode 100644 index 0000000..cf452dc --- /dev/null +++ b/tools/.gitignore @@ -0,0 +1,2 @@ +/*/vendor +/*/composer.lock diff --git a/tools/infection/composer.json b/tools/infection/composer.json new file mode 100644 index 0000000..18be2ea --- /dev/null +++ b/tools/infection/composer.json @@ -0,0 +1,10 @@ +{ + "require-dev": { + "infection/infection": "^0.26 || ^0.31.9" + }, + "config": { + "allow-plugins": { + "infection/extension-installer": true + } + } +} diff --git a/tools/psalm/composer.json b/tools/psalm/composer.json new file mode 100644 index 0000000..4b37abf --- /dev/null +++ b/tools/psalm/composer.json @@ -0,0 +1,5 @@ +{ + "require-dev": { + "vimeo/psalm": "^4.30 || ^5.26.1 || ^6.8.8" + } +} From edac63d3a979f2a2e491cb6e0f76274cec042ee0 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 27 Nov 2025 15:33:50 +0300 Subject: [PATCH 2/6] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b950a8..e83a9f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 1.2.1 under development -- Chg #68: Change PHP constraint in `composer.json` to `7.4.* || 8.0 - 8.5` (@vjik) +- Chg #68, #69: Change PHP constraint in `composer.json` to `7.4.* || 8.0 - 8.5` (@vjik) ## 1.2.0 September 02, 2024 From 32e16ced08c670114b1e127ec549cba9d3547272 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 27 Nov 2025 15:38:15 +0300 Subject: [PATCH 3/6] fix --- composer.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index b365f18..295c72b 100644 --- a/composer.json +++ b/composer.json @@ -33,10 +33,10 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.3", - "maglnet/composer-require-checker": "^3.8 || ^4.17", - "phpunit/phpunit": "^9.6.29", - "rector/rector": "^2.2.8", - "spatie/phpunit-watcher": "^1.24.0" + "maglnet/composer-require-checker": "^3.8 || ^4.4", + "phpunit/phpunit": "^9.6.22", + "rector/rector": "^2.0.10", + "spatie/phpunit-watcher": "^1.23.6" }, "autoload": { "psr-4": { @@ -61,7 +61,6 @@ }, "config": { "sort-packages": true, - "bump-after-update": "dev", "allow-plugins": { "bamarni/composer-bin-plugin": true, "composer/package-versions-deprecated": true From 8b89383d228dca5e4ad0fc8a766355bb7927a2b7 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 27 Nov 2025 15:45:02 +0300 Subject: [PATCH 4/6] psalm --- src/IpHelper.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/IpHelper.php b/src/IpHelper.php index 5ef7406..a2ef835 100644 --- a/src/IpHelper.php +++ b/src/IpHelper.php @@ -201,6 +201,9 @@ public static function ip2bin(string $ip): string $result = ''; for ($i = 0, $iMax = strlen($ipBinary); $i < $iMax; $i += 4) { $data = substr($ipBinary, $i, 4); + /** + * psalm-suppress RiskyTruthyFalsyComparison This is required for PHP 7.4 only. + */ if (empty($data)) { throw new RuntimeException('An error occurred while converting IP address to bits representation.'); } From dcbcef7ac005fddfe97ae9732ace21b53e3e3789 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 27 Nov 2025 15:47:01 +0300 Subject: [PATCH 5/6] fix --- src/IpHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/IpHelper.php b/src/IpHelper.php index a2ef835..5927a36 100644 --- a/src/IpHelper.php +++ b/src/IpHelper.php @@ -202,7 +202,7 @@ public static function ip2bin(string $ip): string for ($i = 0, $iMax = strlen($ipBinary); $i < $iMax; $i += 4) { $data = substr($ipBinary, $i, 4); /** - * psalm-suppress RiskyTruthyFalsyComparison This is required for PHP 7.4 only. + * @psalm-suppress RiskyTruthyFalsyComparison This is required for PHP 7.4 only. */ if (empty($data)) { throw new RuntimeException('An error occurred while converting IP address to bits representation.'); From e6d4341b597d60912bc9b7664d5b358eee18ada9 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Thu, 27 Nov 2025 15:55:04 +0300 Subject: [PATCH 6/6] fix --- tests/DnsHelperTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/DnsHelperTest.php b/tests/DnsHelperTest.php index 7018949..ca9f43f 100644 --- a/tests/DnsHelperTest.php +++ b/tests/DnsHelperTest.php @@ -13,7 +13,7 @@ */ final class DnsHelperTest extends TestCase { - private const NOT_EXISTS_DOMAIN = 'non-exist-for-everrrrrr.domain'; + private const NOT_EXISTS_DOMAIN = 'non-exist-for-everrrrrr.gov'; private const NOT_EXISTS_DOMAIN_EMAIL = 'any@' . self::NOT_EXISTS_DOMAIN; public function testMx(): void