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..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.4` (@vjik) +- Chg #68, #69: 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..295c72b 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": { + "bamarni/composer-bin-plugin": "^1.8.3", "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" + "spatie/phpunit-watcher": "^1.23.6" }, "autoload": { "psr-4": { @@ -53,11 +52,17 @@ "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/src/IpHelper.php b/src/IpHelper.php index 5ef7406..5927a36 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.'); } 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 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" + } +}