From 25ca82e98711d3548d149b82d5d96ddfa39d0f1d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 29 Oct 2025 12:57:14 +0700 Subject: [PATCH 1/3] Patch scoped Recursive rule set lookup on PhpCsFixer RuleSet::resolveSubset() --- composer.json | 5 ++++- ...hp-php-cs-fixer-src-ruleset-ruleset-php.patch | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch diff --git a/composer.json b/composer.json index 3f6533622f..907b04b4f5 100644 --- a/composer.json +++ b/composer.json @@ -87,9 +87,12 @@ }, "extra": { "patches": { + "friendsofphp/php-cs-fixer": [ + "patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch" + ], "illuminate/container": [ "patches/illuminate-container-container-php.patch" ] } } -} +} \ No newline at end of file diff --git a/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch b/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch new file mode 100644 index 0000000000..e5de3ee083 --- /dev/null +++ b/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch @@ -0,0 +1,16 @@ +--- /dev/null ++++ ../src/RuleSet/RuleSet.php +@@ -130,6 +130,13 @@ + */ + private function resolveSubset(string $setName, bool $setValue): array + { ++ // workaround for https://github.com/easy-coding-standard/easy-coding-standard/issues/303 ++ // the real target name already has been resolved ++ // additional with prefix is not needed ++ if (str_starts_with($setName, '@PHPECSPrefix')) { ++ return []; ++ } ++ + $ruleSet = RuleSets::getSetDefinition($setName); + + if ($ruleSet instanceof DeprecatedRuleSetDescriptionInterface) { From fcbf8e3f8ce9fcb187bc0f3eb068558f8478647d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 29 Oct 2025 13:01:10 +0700 Subject: [PATCH 2/3] Re-run Rector --- src/DependencyInjection/LazyContainerFactory.php | 2 +- src/FileSystem/FileFilter.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/DependencyInjection/LazyContainerFactory.php b/src/DependencyInjection/LazyContainerFactory.php index 4485385226..a2876ba980 100644 --- a/src/DependencyInjection/LazyContainerFactory.php +++ b/src/DependencyInjection/LazyContainerFactory.php @@ -67,7 +67,7 @@ static function (Container $container): EasyCodingStandardStyle { } ); - $ecsConfig->singleton(SymfonyStyle::class, static fn (): SymfonyStyle => SymfonyStyleFactory::create()); + $ecsConfig->singleton(SymfonyStyle::class, SymfonyStyleFactory::create(...)); $ecsConfig->singleton(Fixer::class); diff --git a/src/FileSystem/FileFilter.php b/src/FileSystem/FileFilter.php index 04ccb1b3ab..2e13f21fc3 100644 --- a/src/FileSystem/FileFilter.php +++ b/src/FileSystem/FileFilter.php @@ -19,9 +19,6 @@ public function __construct( */ public function filterOnlyChangedFiles(array $filePaths): array { - return array_filter( - $filePaths, - fn (string $filePath): bool => $this->changedFilesDetector->hasFileChanged($filePath) - ); + return array_filter($filePaths, $this->changedFilesDetector->hasFileChanged(...)); } } From 5c860f98b3cd4aeefb0309960a4d366595ecd00e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 29 Oct 2025 15:19:18 +0700 Subject: [PATCH 3/3] use contains ECSPrefix --- patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch b/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch index e5de3ee083..aa0915318a 100644 --- a/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch +++ b/patches/friendsofphp-php-cs-fixer-src-ruleset-ruleset-php.patch @@ -7,7 +7,7 @@ + // workaround for https://github.com/easy-coding-standard/easy-coding-standard/issues/303 + // the real target name already has been resolved + // additional with prefix is not needed -+ if (str_starts_with($setName, '@PHPECSPrefix')) { ++ if (str_contains($setName, 'ECSPrefix')) { + return []; + } +