Skip to content

Commit bd6fe4f

Browse files
[Scoper] Remove PHP_VERSION_ID < 70400 check on scoper.php (#7162)
* [Scoper] Remove PHP_VERSION_ID < 70400 check on scoper.php * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
1 parent cbc8ee5 commit bd6fe4f

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

rules/CodeQuality/Rector/Class_/StaticToSelfStaticMethodCallOnFinalClassRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@ public function refactor(Node $node): ?Class_
105105
return null;
106106
}
107107

108-
$methodReflection = $classReflection->getNativeMethod($methodName);
108+
$extendedMethodReflection = $classReflection->getNativeMethod($methodName);
109109

110110
// avoid overlapped change
111-
if (! $methodReflection->isStatic()) {
111+
if (! $extendedMethodReflection->isStatic()) {
112112
return null;
113113
}
114114

scoper.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -142,25 +142,5 @@ static function (string $filePath, string $prefix, string $content): string {
142142

143143
return str_replace("'" . $prefix . '\\', "'\\", $content);
144144
},
145-
146-
static function (string $filePath, string $prefix, string $content): string {
147-
if (! \str_ends_with($filePath, 'vendor/nette/utils/src/Utils/Strings.php')) {
148-
return $content;
149-
}
150-
151-
# see https://github.com/rectorphp/rector/issues/8564
152-
return str_replace(
153-
'return self::pcre(\'preg_replace_callback\', [$pattern, $replacement, $subject, $limit, 0, $flags]);',
154-
<<<'CODE_REPLACE'
155-
if (PHP_VERSION_ID < 70400) {
156-
return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit]);
157-
}
158-
159-
return self::pcre('preg_replace_callback', [$pattern, $replacement, $subject, $limit, 0, $flags]);
160-
CODE_REPLACE
161-
,
162-
$content
163-
);
164-
},
165145
],
166146
];

0 commit comments

Comments
 (0)