Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ jobs:
tests:
uses: jackd248/reusable-github-actions/.github/workflows/tests-php.yml@main
with:
php-versions: '["8.1", "8.2", "8.3", "8.4", "8.5"]'
php-versions: '["8.2", "8.3", "8.4", "8.5"]'
dependencies: '["highest", "lowest"]'
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"ext-tokenizer": "*",
"friendsofphp/php-cs-fixer": "^3.14"
},
"require-dev": {
"armin/editorconfig-cli": "^1.0 || ^2.0",
"armin/editorconfig-cli": "^2.0",
"ergebnis/composer-normalize": "^2.44",
"konradmichalik/php-cs-fixer-preset": "^0.1.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "^10.2 || ^11.0 || ^12.0",
"phpunit/phpunit": "^11.0 || ^12.0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Critical: PHPUnit constraint incompatible with PHP 8.2.

The pipeline failure confirms that PHPUnit 12 requires PHP 8.3+. The constraint ^11.0 || ^12.0 allows Composer to install PHPUnit 12, which is incompatible with PHP 8.2.

Please verify the PHP version requirements for PHPUnit 11 and 12:


🌐 Web query:

What are the minimum PHP version requirements for PHPUnit 11 and PHPUnit 12?

💡 Result:

  • PHPUnit 11: requires PHP 8.2 or later. [1]
  • PHPUnit 12: requires PHP 8.3 or later. [2]

Sources: PHPUnit 11 announcement / docs and PHPUnit 12 announcement. [1] https://phpunit.de/announcements/phpunit-11.html [2] https://phpunit.de/announcements/phpunit-12.html


Critical: PHPUnit constraint breaks PHP 8.2 compatibility.

PHPUnit 11 requires PHP 8.2 or later, while PHPUnit 12 requires PHP 8.3 or later. The constraint ^11.0 || ^12.0 allows Composer to install PHPUnit 12, which is incompatible with PHP 8.2.

If PHP 8.2 support is intended, change the constraint to ^11.0 to prevent PHPUnit 12 installation. If the project is dropping PHP 8.2 support in favor of 8.3+, this constraint is acceptable but should be documented as a breaking change in the project's PHP version policy.

🤖 Prompt for AI Agents
In composer.json around line 35, the dev dependency constraint
"phpunit/phpunit": "^11.0 || ^12.0" can allow PHPUnit 12 which requires PHP 8.3
and thus breaks PHP 8.2 compatibility; if you must keep PHP 8.2 support, change
the constraint to "phpunit/phpunit": "^11.0" in composer.json, run composer
update --lock or composer update phpunit/phpunit to update the lockfile and CI,
and if instead you intend to drop PHP 8.2 support, leave the constraint but
update project documentation/CI to state PHP 8.3+ as a breaking change.

"rector/rector": "^2.2"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
__DIR__.'/src',
__DIR__.'/tests',
])
->withPhpVersion(PhpVersion::PHP_81)
->withPhpVersion(PhpVersion::PHP_82)
->withSets([
LevelSetList::UP_TO_PHP_81,
LevelSetList::UP_TO_PHP_82,
])
->withComposerBased(symfony: true)
->withRules([
Expand Down
10 changes: 5 additions & 5 deletions src/Generators/DocBlockHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@
* @author Konrad Michalik <hej@konradmichalik.dev>
* @license GPL-3.0-or-later
*/
final class DocBlockHeader implements Generator
final readonly class DocBlockHeader implements Generator
{
private function __construct(
/** @var array<string, string|array<string>> */
public readonly array $annotations,
public readonly bool $preserveExisting,
public readonly Separate $separate,
public readonly bool $addStructureName,
public array $annotations,
public bool $preserveExisting,
public Separate $separate,
public bool $addStructureName,
) {}

/**
Expand Down
Loading