diff --git a/rules/CodeQuality/Rector/Class_/StaticToSelfStaticMethodCallOnFinalClassRector.php b/rules/CodeQuality/Rector/Class_/StaticToSelfStaticMethodCallOnFinalClassRector.php index a0e6be02fa1..9ccd4a269dd 100644 --- a/rules/CodeQuality/Rector/Class_/StaticToSelfStaticMethodCallOnFinalClassRector.php +++ b/rules/CodeQuality/Rector/Class_/StaticToSelfStaticMethodCallOnFinalClassRector.php @@ -105,10 +105,10 @@ public function refactor(Node $node): ?Class_ return null; } - $methodReflection = $classReflection->getNativeMethod($methodName); + $extendedMethodReflection = $classReflection->getNativeMethod($methodName); // avoid overlapped change - if (! $methodReflection->isStatic()) { + if (! $extendedMethodReflection->isStatic()) { return null; } diff --git a/scoper.php b/scoper.php index 5f9bcf6d3c0..73d00ecf873 100644 --- a/scoper.php +++ b/scoper.php @@ -142,25 +142,5 @@ static function (string $filePath, string $prefix, string $content): string { return str_replace("'" . $prefix . '\\', "'\\", $content); }, - - static function (string $filePath, string $prefix, string $content): string { - if (! \str_ends_with($filePath, 'vendor/nette/utils/src/Utils/Strings.php')) { - return $content; - } - - # see https://github.com/rectorphp/rector/issues/8564 - return str_replace( - 'return self::pcre(\'preg_replace_callback\', [$pattern, $replacement, $subject, $limit, 0, $flags]);', - <<<'CODE_REPLACE' -if (PHP_VERSION_ID < 70400) { - return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit]); -} - -return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit, 0, $flags]); -CODE_REPLACE - , - $content - ); - }, ], ];