diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e96052e..68fac01 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -31,4 +31,4 @@ jobs:
os: >-
['ubuntu-latest', 'windows-latest']
php: >-
- ['8.0', '8.1', '8.2', '8.3']
+ ['8.0', '8.1', '8.2', '8.3', '8.4']
diff --git a/.github/workflows/composer-require-checker.yml b/.github/workflows/composer-require-checker.yml
index 5473ec9..632bfd4 100644
--- a/.github/workflows/composer-require-checker.yml
+++ b/.github/workflows/composer-require-checker.yml
@@ -31,4 +31,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
- ['8.0', '8.1', '8.2', '8.3']
+ ['8.0', '8.1', '8.2', '8.3', '8.4']
diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml
index 457772a..5d6931d 100644
--- a/.github/workflows/rector.yml
+++ b/.github/workflows/rector.yml
@@ -21,4 +21,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
- ['8.3']
+ ['8.4']
diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml
index d873c39..28a40b8 100644
--- a/.github/workflows/static.yml
+++ b/.github/workflows/static.yml
@@ -24,26 +24,26 @@ on:
name: static analysis
jobs:
- psalm:
+ psalm80:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
+ psalm-config: psalm80.xml
os: >-
['ubuntu-latest']
php: >-
- ['8.1', '8.2']
- psalm80:
+ ['8.0']
+ psalm81-82:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
- psalm-config: psalm80.xml
+ psalm-config: psalm81-82.xml
os: >-
['ubuntu-latest']
php: >-
- ['8.0']
- psalm83:
+ ['8.1', '8.2']
+ psalm:
uses: yiisoft/actions/.github/workflows/psalm.yml@master
with:
- psalm-config: psalm83.xml
os: >-
['ubuntu-latest']
php: >-
- ['8.3']
+ ['8.3', '8.4']
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37b10e0..46e2aa4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,7 @@
## 1.0.3 under development
-- no changes in this release.
+- Chg #44: Change PHP constraint in `composer.json` to `8.0 - 8.4` (@vjik)
## 1.0.2 August 06, 2024
diff --git a/composer.json b/composer.json
index 1414345..288311a 100644
--- a/composer.json
+++ b/composer.json
@@ -29,23 +29,23 @@
],
"prefer-stable": true,
"require": {
- "php": "^8.0",
+ "php": "8.0 - 8.4",
"ext-filter": "*",
- "psr/http-message": "^1.0|^2.0",
+ "psr/http-message": "^1.0 || ^2.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"yiisoft/http": "^1.2",
"yiisoft/network-utilities": "^1.1"
},
"require-dev": {
- "httpsoft/http-message": "^1.0",
+ "httpsoft/http-message": "^1.1.6",
"maglnet/composer-require-checker": "^4.4",
- "phpunit/phpunit": "^9.5",
- "rector/rector": "^0.16.0",
- "roave/infection-static-analysis-plugin": "^1.16",
- "spatie/phpunit-watcher": "^1.23",
- "vimeo/psalm": "^4.30|^5.24",
- "yiisoft/test-support": "^3.0"
+ "phpunit/phpunit": "^9.6.22",
+ "rector/rector": "^2.0.10",
+ "roave/infection-static-analysis-plugin": "^1.25",
+ "spatie/phpunit-watcher": "^1.23.6",
+ "vimeo/psalm": "^4.30 || ^5.26.1 || ^6.9.1",
+ "yiisoft/test-support": "^3.0.2"
},
"autoload": {
"psr-4": {
diff --git a/psalm.xml b/psalm.xml
index b48c894..11ada94 100644
--- a/psalm.xml
+++ b/psalm.xml
@@ -3,6 +3,7 @@
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
+ ensureOverrideAttribute="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -16,5 +17,6 @@
+
diff --git a/psalm83.xml b/psalm81-82.xml
similarity index 91%
rename from psalm83.xml
rename to psalm81-82.xml
index ee80eb3..2b2e0b2 100644
--- a/psalm83.xml
+++ b/psalm81-82.xml
@@ -3,6 +3,7 @@
errorLevel="1"
findUnusedBaselineEntry="true"
findUnusedCode="false"
+ ensureOverrideAttribute="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
@@ -16,6 +17,5 @@
-
diff --git a/rector.php b/rector.php
index 20acccd..c2226bf 100644
--- a/rector.php
+++ b/rector.php
@@ -4,26 +4,17 @@
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
-use Rector\Php56\Rector\FunctionLike\AddDefaultValueForUndefinedVariableRector;
use Rector\Php74\Rector\Closure\ClosureToArrowFunctionRector;
-use Rector\Set\ValueObject\LevelSetList;
-return static function (RectorConfig $rectorConfig): void {
- $rectorConfig->paths([
+return RectorConfig::configure()
+ ->withPaths([
__DIR__ . '/src',
__DIR__ . '/tests',
- ]);
-
- // register a single rule
- $rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
-
- // define sets of rules
- $rectorConfig->sets([
- LevelSetList::UP_TO_PHP_80,
- ]);
-
- $rectorConfig->skip([
+ ])
+ ->withPhpSets(php80: true)
+ ->withRules([
+ InlineConstructorDefaultToPropertyRector::class,
+ ])
+ ->withSkip([
ClosureToArrowFunctionRector::class,
- AddDefaultValueForUndefinedVariableRector::class,
]);
-};
diff --git a/src/TrustedHostsNetworkResolver.php b/src/TrustedHostsNetworkResolver.php
index 444b4dd..19877ca 100644
--- a/src/TrustedHostsNetworkResolver.php
+++ b/src/TrustedHostsNetworkResolver.php
@@ -62,6 +62,8 @@
* port: ?int,
* ipIdentifier: ?non-empty-string,
* }
+ *
+ * @psalm-suppress ClassMustBeFinal We allow to extend this class.
*/
class TrustedHostsNetworkResolver implements MiddlewareInterface
{
@@ -522,7 +524,7 @@ private function normalizeHeaderName(string $headerName): string
/**
* @psalm-param non-empty-string $remoteAddr
*
- * @psalm-return array{0: ForwardedHeaderGroup, 1: list}
+ * @psalm-return array{0: ForwardedHeaderGroup, 1: non-empty-list}
*
* @throws InvalidConnectionChainItemException
* @throws RfcProxyParseException
@@ -551,6 +553,9 @@ private function getConnectionChainItems(string $remoteAddr, ServerRequestInterf
}
$items = [];
+ /**
+ * @psalm-var non-empty-list $requestIps It needs for PHP 8.0 only
+ */
$requestIps = array_merge([$remoteAddr], array_reverse($forwardedHeaderValue));
foreach ($requestIps as $requestIp) {
$items[] = $this->getConnectionChainItem(
@@ -761,7 +766,7 @@ private function getConnectionChainItem(
}
/**
- * @psalm-param list $items
+ * @psalm-param non-empty-list $items
* @psalm-param list $validatedItems
* @psalm-param-out list $validatedItems
*