diff --git a/src/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector.php b/src/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector.php index 798eb3f0..07db13c7 100644 --- a/src/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector.php +++ b/src/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector.php @@ -144,7 +144,7 @@ private function isScopeMethod(ClassMethod $classMethod): bool { $name = $this->getName($classMethod); - if (str_starts_with((string) $name, 'scope')) { + if ((bool) preg_match('/^scope.+$/', $name)) { return true; } diff --git a/tests/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector/Fixture/skip_scope_method_not_scope.php.inc b/tests/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector/Fixture/skip_scope_method_not_scope.php.inc new file mode 100644 index 00000000..da1d55f8 --- /dev/null +++ b/tests/Rector/ClassMethod/MakeModelAttributesAndScopesProtectedRector/Fixture/skip_scope_method_not_scope.php.inc @@ -0,0 +1,15 @@ +