-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
type/bugSomething is brokenSomething is brokenversion/11Something affects PHPUnit 11Something affects PHPUnit 11
Description
| Q | A |
|---|---|
| PHPUnit version | 11.0 |
| PHP version | 8.2.15 |
| Installation Method | Composer / PHAR |
Summary
PHPUnit 11.0 has changed the Constraint class to mark it readonly. This is a BC break for all child class (i.e. all custom constraints) because PHP requires that child classes have the same readonly flag than their parent (so either both readonly or none).
This BC break is not mentioned anywhere in the changelog. And it will make it very hard to define custom constraints compatible with multiple PHPUnit versions as it will require using conditional class definitions.
Current behavior
How to reproduce
Install PHPUnit 11 and use custom constraints that were written against previous versions. See symfony/symfony#53731
Expected behavior
Metadata
Metadata
Assignees
Labels
type/bugSomething is brokenSomething is brokenversion/11Something affects PHPUnit 11Something affects PHPUnit 11