Skip to content

Commit 9b8e12b

Browse files
committed
Require PHPStan 2.0.4 or newer in the 2.x series
Target a single PHPStan major version and align the declared minimum with the pinned compatibility job. Remove the 1.x development dependency alternatives and inline the remaining strict-rules settings. This drops support for PHPStan 1.x and 2.0.0 through 2.0.3. Keep the runtime capability checks needed across supported 2.x versions.
1 parent f3bc7af commit 9b8e12b

7 files changed

Lines changed: 35 additions & 32 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ jobs:
118118
fail-fast: false
119119
matrix:
120120
include:
121-
- phpstan-version: "1.12.1"
122-
phpstan-constraint: "1.12.1"
123-
phpstan-phpunit-constraint: "^1.4.2"
124-
phpstan-strict-rules-constraint: "1.5.2"
125-
php-parser-constraint: "^4.19.5"
126121
- phpstan-version: "2.0.4"
127122
phpstan-constraint: "2.0.4"
128123
phpstan-phpunit-constraint: "2.0.6"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
## Installation
99

10+
Requires PHP `^8.1` and PHPStan `^2.0.4`.
11+
1012
To use this extension, require it in [Composer](https://getcomposer.org/):
1113

1214
```bash

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
],
1313
"require": {
1414
"php": "^8.1",
15-
"phpstan/phpstan": "^1.12.1 || ^2.0"
15+
"phpstan/phpstan": "^2.0.4"
1616
},
1717
"autoload": {
1818
"psr-4": {
@@ -22,8 +22,8 @@
2222
"require-dev": {
2323
"composer-runtime-api": "*",
2424
"jbboehr/akashi": "^0.2",
25-
"phpstan/phpstan-phpunit": "^1.4.2 || ^2.0.6",
26-
"phpstan/phpstan-strict-rules": "^1.5.2 || ^2.0.4",
25+
"phpstan/phpstan-phpunit": "^2.0.6",
26+
"phpstan/phpstan-strict-rules": "^2.0.4",
2727
"phpunit/phpunit": "^10.5.62 || ^11.5.50",
2828
"slevomat/coding-standard": "^8.18",
2929
"squizlabs/php_codesniffer": "^3.13",

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/development/compatibility.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependency compatibility
2+
3+
The supported requirements are PHP `^8.1` and PHPStan `^2.0.4`.
4+
PHPStan 1.x is no longer supported. This dependency restriction is a breaking
5+
compatibility change for users on 1.x or PHPStan 2.0.0 through 2.0.3.
6+
7+
The PHPStan floor matches the exact version exercised by the compatibility CI
8+
job. The regular test jobs resolve current dependencies permitted by Composer;
9+
the compatibility job pins PHPStan 2.0.4, phpstan-phpunit 2.0.6, and
10+
phpstan-strict-rules 2.0.4 on PHP 8.1.
11+
12+
Supporting only 2.x removes the separate 1.x development dependency constraints
13+
and strict-rules configuration branch. PHPStan also recommends targeting one
14+
major version in its [extension upgrade guide](https://phpstan.org/blog/upgrading-from-phpstan-1-to-2).
15+
16+
Keep capability checks that cover differences within 2.x. In particular,
17+
unsealed array shapes were introduced in
18+
[PHPStan 2.2](https://phpstan.org/blog/phpstan-2-2-unsealed-array-shapes-safer-array-keys),
19+
so requiring 2.0.4 does not make the unsealed-shape fallbacks obsolete. Renderer
20+
differences within 2.x still matter to the test fixtures as well.
21+
22+
When changing the minimum again, update Composer requirements, the pinned CI
23+
case, and the installation requirements together. Run the complete suite,
24+
including the [behavior contract](behavior-contract.md), on the proposed floor
25+
and the installed current version before removing compatibility code. Keep
26+
changes to inference behavior in a separate slice.

phpstan-strict-rules.php

Lines changed: 0 additions & 22 deletions
This file was deleted.

phpstan.neon.dist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ includes:
33
- vendor/phpstan/phpstan-phpunit/extension.neon
44
- vendor/phpstan/phpstan-phpunit/rules.neon
55
- vendor/phpstan/phpstan-strict-rules/rules.neon
6-
- phpstan-strict-rules.php
76
- extension.neon
87
parameters:
8+
strictRules:
9+
disallowedShortTernary: false
10+
dynamicCallOnStaticMethod: false
911
level: max
1012
paths:
1113
- src

0 commit comments

Comments
 (0)