From b8c63bd66cdaebefc5029b4fbd24c510fdc63e43 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 9 Jun 2026 22:36:23 +0100 Subject: [PATCH 1/6] bump deps --- composer.json | 20 ++-- rector.php | 6 ++ src/Configuration/ConfigInitializer.php | 8 +- src/Configuration/ECSConfigBuilder.php | 6 +- src/Skipper/Matcher/FileInfoMatcher.php | 11 +-- .../EditorConfig/EditorConfigFactoryTest.php | 91 ++++++++++--------- 6 files changed, 73 insertions(+), 69 deletions(-) diff --git a/composer.json b/composer.json index cfba02408c1..346db846214 100644 --- a/composer.json +++ b/composer.json @@ -12,33 +12,33 @@ "bin/ecs" ], "require": { - "php": ">=8.3", + "php": ">=8.4", "composer/pcre": "^3.3.2", "composer/xdebug-handler": "^3.0.5", "entropy/entropy": "dev-main", - "friendsofphp/php-cs-fixer": "^3.95.1|^4.0", + "friendsofphp/php-cs-fixer": "^3.95.5", "illuminate/container": "12.39.*", - "nette/utils": "4.0.8", - "sebastian/diff": "^6.0|^7.0", + "nette/utils": "^4.1", + "sebastian/diff": "^9.0", "squizlabs/php_codesniffer": "^4.0.1", "symfony/console": "^6.4.24", "symfony/finder": "^7.4", - "symplify/coding-standard": "^13.0", + "symplify/coding-standard": "^13.1", "symplify/easy-parallel": "^11.2.2", - "webmozart/assert": "^2.3" + "webmozart/assert": "^2.4" }, "require-dev": { "phpstan/extension-installer": "^1.4.3", - "phpstan/phpstan": "^2.1.54", + "phpstan/phpstan": "^2.2", "phpstan/phpstan-phpunit": "^2.0.16", "phpstan/phpstan-webmozart-assert": "^2.0", - "phpunit/phpunit": "^12.5.4", + "phpunit/phpunit": "^13.0", "rector/jack": "^1.0", "rector/rector": "^2.4", "rector/type-perfect": "^2.1", - "symplify/phpstan-extensions": "^12.0", + "symplify/phpstan-extensions": "^12.0|^13.0", "symplify/vendor-patches": "^11.5", - "tomasvotruba/class-leak": "^2.1", + "tomasvotruba/class-leak": "^2.1|^3.0", "tomasvotruba/type-coverage": "^2.1", "tomasvotruba/unused-public": "^2.1|^3.0", "tracy/tracy": "^2.11|^3.0" diff --git a/rector.php b/rector.php index 3e079631dc2..a6441607bbe 100644 --- a/rector.php +++ b/rector.php @@ -28,4 +28,10 @@ // conditional checks RemovePhpVersionIdCheckRector::class, + + \Rector\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector::class => [ + // avoid runtime reporting in output, only for the user + __DIR__ . '/src/ValueObject/Option.php', + __DIR__ . '/src/ValueObject/Set/SetList.php', + ], ]); diff --git a/src/Configuration/ConfigInitializer.php b/src/Configuration/ConfigInitializer.php index cfdb7d60018..f6130324e74 100644 --- a/src/Configuration/ConfigInitializer.php +++ b/src/Configuration/ConfigInitializer.php @@ -21,13 +21,7 @@ public function __construct( public function areSomeCheckersRegistered(): bool { $fileProcessors = $this->fileProcessorCollector->getFileProcessors(); - foreach ($fileProcessors as $fileProcessor) { - if ($fileProcessor->getCheckers()) { - return true; - } - } - - return false; + return array_any($fileProcessors, fn ($fileProcessor) => $fileProcessor->getCheckers()); } public function createConfig(string $projectDirectory): void diff --git a/src/Configuration/ECSConfigBuilder.php b/src/Configuration/ECSConfigBuilder.php index ea4985cf56f..753baa9d7b1 100644 --- a/src/Configuration/ECSConfigBuilder.php +++ b/src/Configuration/ECSConfigBuilder.php @@ -216,7 +216,8 @@ public function withSkip(array $skip): self */ public function withRootFiles(): self { - $rootPhpFilesFinder = (new Finder())->files() + $rootPhpFilesFinder = new Finder() + ->files() ->in(getcwd()) ->depth(0) ->name('*.php'); @@ -887,7 +888,8 @@ private function applyEditorConfigSettings(): void * * @see \Symplify\EasyCodingStandard\DependencyInjection\CompilerPass\RemoveMutualCheckersCompilerPass */ - $editorConfig = (new EditorConfigFactory())->load(); + $editorConfig = new EditorConfigFactory() + ->load(); if ($editorConfig->indentStyle !== null) { $this->indentation = match ($editorConfig->indentStyle) { diff --git a/src/Skipper/Matcher/FileInfoMatcher.php b/src/Skipper/Matcher/FileInfoMatcher.php index 9af38ce74b8..f38f880dff5 100644 --- a/src/Skipper/Matcher/FileInfoMatcher.php +++ b/src/Skipper/Matcher/FileInfoMatcher.php @@ -23,13 +23,10 @@ public function __construct( */ public function doesFileInfoMatchPatterns(SplFileInfo | string $fileInfo, array $filePatterns): bool { - foreach ($filePatterns as $filePattern) { - if ($this->doesFileInfoMatchPattern($fileInfo, $filePattern)) { - return true; - } - } - - return false; + return array_any( + $filePatterns, + fn (string $filePattern): bool => $this->doesFileInfoMatchPattern($fileInfo, $filePattern) + ); } /** diff --git a/tests/Configuration/EditorConfig/EditorConfigFactoryTest.php b/tests/Configuration/EditorConfig/EditorConfigFactoryTest.php index 03939edc2db..149a91fefe6 100644 --- a/tests/Configuration/EditorConfig/EditorConfigFactoryTest.php +++ b/tests/Configuration/EditorConfig/EditorConfigFactoryTest.php @@ -56,8 +56,9 @@ public function testParsingInvalidIniFile(): void public function testLoadsExpectedSections(): void { $this->assertEquals( - (new EditorConfigFactory())->parse( - <<parse( + <<assertEquals( - (new EditorConfigFactory())->parse(''), + new EditorConfigFactory() + ->parse(''), new EditorConfig( indentStyle: null, endOfLine: null, @@ -96,12 +98,12 @@ public function testEmpty(): void public function testIndentStyleSpaces(): void { $this->assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse( + <<assertEquals( - (new EditorConfigFactory())->parse( - <<parse( + <<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse( + <<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<<assertEquals( - (new EditorConfigFactory())->parse( - <<parse(<< Date: Tue, 9 Jun 2026 23:17:09 +0100 Subject: [PATCH 2/6] bump deps --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 346db846214..942e5105ea4 100644 --- a/composer.json +++ b/composer.json @@ -36,7 +36,7 @@ "rector/jack": "^1.0", "rector/rector": "^2.4", "rector/type-perfect": "^2.1", - "symplify/phpstan-extensions": "^12.0|^13.0", + "symplify/phpstan-rules": "^14.11", "symplify/vendor-patches": "^11.5", "tomasvotruba/class-leak": "^2.1|^3.0", "tomasvotruba/type-coverage": "^2.1", From f36b98785d9e2b6eb1b251580836e7007a05d6a7 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 9 Jun 2026 23:19:57 +0100 Subject: [PATCH 3/6] bump --- .github/workflows/along_with_symfony_deprecations.yaml | 2 +- .github/workflows/buid_release.yaml | 2 +- .github/workflows/code_analysis.yaml | 2 +- .github/workflows/version_command.yaml | 2 +- CLAUDE.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/along_with_symfony_deprecations.yaml b/.github/workflows/along_with_symfony_deprecations.yaml index 454ac68502b..daba87dba42 100644 --- a/.github/workflows/along_with_symfony_deprecations.yaml +++ b/.github/workflows/along_with_symfony_deprecations.yaml @@ -13,7 +13,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - run: mkdir nested-dir diff --git a/.github/workflows/buid_release.yaml b/.github/workflows/buid_release.yaml index 6ffb1f0da5b..1b286c716c3 100644 --- a/.github/workflows/buid_release.yaml +++ b/.github/workflows/buid_release.yaml @@ -20,7 +20,7 @@ jobs: - uses: "shivammathur/setup-php@v2" with: - php-version: 8.3 + php-version: 8.4 coverage: none # invoke patches diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index 5867996af27..63bb03f82c7 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -44,7 +44,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none # composer install cache - https://github.com/ramsey/composer-install diff --git a/.github/workflows/version_command.yaml b/.github/workflows/version_command.yaml index 28b95f4e6b4..a0144274eec 100644 --- a/.github/workflows/version_command.yaml +++ b/.github/workflows/version_command.yaml @@ -23,7 +23,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.4 coverage: none - run: mkdir nested-dir diff --git a/CLAUDE.md b/CLAUDE.md index 40a9cc5b8b6..e3bcfea1130 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -6,7 +6,7 @@ Guidance for Claude Code when working in this repository. **Symplify EasyCodingStandard (ECS)** — a unified runner for PHP-CS-Fixer and PHP_CodeSniffer. Users configure rules through a fluent PHP API (`ECSConfig::configure()->with...()`) instead of dealing with each tool's native config format. -- PHP `>=8.3` +- PHP `>=8.4` - Entry binary: `bin/ecs` - PSR-4: `Symplify\EasyCodingStandard\` → `src/` - Tests PSR-4: `Symplify\EasyCodingStandard\Tests\` → `tests/` From 741b14dc41dc17f273ac530fb38c93b1d8fffc9c Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 9 Jun 2026 23:20:37 +0100 Subject: [PATCH 4/6] use entropy 3 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 942e5105ea4..cbc1e50dd5d 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "php": ">=8.4", "composer/pcre": "^3.3.2", "composer/xdebug-handler": "^3.0.5", - "entropy/entropy": "dev-main", + "entropy/entropy": "^0.3", "friendsofphp/php-cs-fixer": "^3.95.5", "illuminate/container": "12.39.*", "nette/utils": "^4.1", @@ -38,7 +38,7 @@ "rector/type-perfect": "^2.1", "symplify/phpstan-rules": "^14.11", "symplify/vendor-patches": "^11.5", - "tomasvotruba/class-leak": "^2.1|^3.0", + "tomasvotruba/class-leak": "^2.1.6", "tomasvotruba/type-coverage": "^2.1", "tomasvotruba/unused-public": "^2.1|^3.0", "tracy/tracy": "^2.11|^3.0" From a6cb91beaf06bec9d2135ed4bd7f3d82f74ac87c Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 9 Jun 2026 23:21:15 +0100 Subject: [PATCH 5/6] use entropy 3 --- phpstan.neon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpstan.neon b/phpstan.neon index 51f9c79ec5b..db893ee7f90 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,6 +6,9 @@ parameters: # requires exact closure types checkMissingCallableSignature: true + # symplify - see https://github.com/symplify/phpstan-rules#usage + pathStrings: true + paths: - src - tests From 9d8df7f06d09237202d90e9d0df68dc73c0db902 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Tue, 9 Jun 2026 23:22:24 +0100 Subject: [PATCH 6/6] fix phpstan --- composer.json | 6 +++--- rector.php | 3 ++- src/Configuration/ConfigInitializer.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index cbc1e50dd5d..c5222e3d551 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "symfony/console": "^6.4.24", "symfony/finder": "^7.4", "symplify/coding-standard": "^13.1", - "symplify/easy-parallel": "^11.2.2", + "symplify/easy-parallel": "^11.2", "webmozart/assert": "^2.4" }, "require-dev": { @@ -40,8 +40,8 @@ "symplify/vendor-patches": "^11.5", "tomasvotruba/class-leak": "^2.1.6", "tomasvotruba/type-coverage": "^2.1", - "tomasvotruba/unused-public": "^2.1|^3.0", - "tracy/tracy": "^2.11|^3.0" + "tomasvotruba/unused-public": "^2.2", + "tracy/tracy": "^2.12" }, "autoload": { "psr-4": { diff --git a/rector.php b/rector.php index a6441607bbe..a0d10051856 100644 --- a/rector.php +++ b/rector.php @@ -4,6 +4,7 @@ use Rector\Config\RectorConfig; use Rector\DeadCode\Rector\ConstFetch\RemovePhpVersionIdCheckRector; +use Rector\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector; return RectorConfig::configure() ->withPhpSets() @@ -29,7 +30,7 @@ // conditional checks RemovePhpVersionIdCheckRector::class, - \Rector\Php84\Rector\Class_\DeprecatedAnnotationToDeprecatedAttributeRector::class => [ + DeprecatedAnnotationToDeprecatedAttributeRector::class => [ // avoid runtime reporting in output, only for the user __DIR__ . '/src/ValueObject/Option.php', __DIR__ . '/src/ValueObject/Set/SetList.php', diff --git a/src/Configuration/ConfigInitializer.php b/src/Configuration/ConfigInitializer.php index f6130324e74..41a417d026b 100644 --- a/src/Configuration/ConfigInitializer.php +++ b/src/Configuration/ConfigInitializer.php @@ -21,7 +21,7 @@ public function __construct( public function areSomeCheckersRegistered(): bool { $fileProcessors = $this->fileProcessorCollector->getFileProcessors(); - return array_any($fileProcessors, fn ($fileProcessor) => $fileProcessor->getCheckers()); + return array_any($fileProcessors, fn ($fileProcessor): bool => $fileProcessor->getCheckers() !== []); } public function createConfig(string $projectDirectory): void