From 14e2eb8b97dc903beb4159f22be9867ddbb5a16d Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 29 Oct 2025 15:42:47 +0700 Subject: [PATCH 1/3] [Scoper] Fix Scoper on AbstractMajorMinorDeprecationSetDefinition --- scoper.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scoper.php b/scoper.php index 39303209bf..2d95f4026b 100644 --- a/scoper.php +++ b/scoper.php @@ -136,5 +136,18 @@ function (string $filePath, string $prefix, string $content): string { '@release_date@' => $releaseDateTime->format('Y-m-d H:i:s'), ]); }, + + static function (string $filePath, string $prefix, string $content): string { + if (! \str_ends_with($filePath, 'vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMajorMinorDeprecationSetDefinition.php')) { + return $content; + } + + // remove prefix in quote + return str_replace( + "'$prefix\\", + "\\", + $content + ); + }, ], ]; From afa31ff80955d75b601ec38e731d75071058b429 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 29 Oct 2025 15:45:14 +0700 Subject: [PATCH 2/3] rectify --- scoper.php | 11 +++++------ src/DependencyInjection/LazyContainerFactory.php | 2 +- src/FileSystem/FileFilter.php | 5 +---- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/scoper.php b/scoper.php index 2d95f4026b..c5b364bb2d 100644 --- a/scoper.php +++ b/scoper.php @@ -138,16 +138,15 @@ function (string $filePath, string $prefix, string $content): string { }, static function (string $filePath, string $prefix, string $content): string { - if (! \str_ends_with($filePath, 'vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMajorMinorDeprecationSetDefinition.php')) { + if (! \str_ends_with( + $filePath, + 'vendor/friendsofphp/php-cs-fixer/src/RuleSet/AbstractMajorMinorDeprecationSetDefinition.php' + )) { return $content; } // remove prefix in quote - return str_replace( - "'$prefix\\", - "\\", - $content - ); + return str_replace("'{$prefix}\\", '\\', $content); }, ], ]; 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 afc98a74b99ec4db8d9c54f12e1a11039b3300fb Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 29 Oct 2025 15:47:36 +0700 Subject: [PATCH 3/3] fix missing quote --- scoper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scoper.php b/scoper.php index c5b364bb2d..3480415447 100644 --- a/scoper.php +++ b/scoper.php @@ -146,7 +146,7 @@ static function (string $filePath, string $prefix, string $content): string { } // remove prefix in quote - return str_replace("'{$prefix}\\", '\\', $content); + return str_replace("'{$prefix}\\", "'\\", $content); }, ], ];