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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
20 changes: 0 additions & 20 deletions scoper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
},
],
];
Loading