diff --git a/rules/CodeQuality/Rector/Class_/GetRepositoryServiceLocatorToRepositoryServiceInjectionRector.php b/rules/CodeQuality/Rector/Class_/GetRepositoryServiceLocatorToRepositoryServiceInjectionRector.php index 39c277cb..71545cc1 100644 --- a/rules/CodeQuality/Rector/Class_/GetRepositoryServiceLocatorToRepositoryServiceInjectionRector.php +++ b/rules/CodeQuality/Rector/Class_/GetRepositoryServiceLocatorToRepositoryServiceInjectionRector.php @@ -158,9 +158,9 @@ public function refactor(Node $node): ?Class_ $repositoryClassReflection = $this->reflectionProvider->getClass($repositoryClass); - if (! $repositoryClassReflection->isSubclassOf( + if (! $repositoryClassReflection->is( DoctrineClass::SERVICE_DOCUMENT_REPOSITORY - ) && ! $repositoryClassReflection->isSubclassOf(DoctrineClass::SERVICE_ENTITY_REPOSITORY)) { + ) && ! $repositoryClassReflection->is(DoctrineClass::SERVICE_ENTITY_REPOSITORY)) { return null; } @@ -198,14 +198,14 @@ private function shouldSkipClass(Class_ $class): bool } // skip repositories themselves to avoid circular dependencies - if ($classReflection->isSubclassOf(DoctrineClass::OBJECT_REPOSITORY)) { + if ($classReflection->is(DoctrineClass::OBJECT_REPOSITORY)) { return true; } - if ($classReflection->isSubclassOf(DoctrineClass::ENTITY_REPOSITORY)) { + if ($classReflection->is(DoctrineClass::ENTITY_REPOSITORY)) { return true; } - return $classReflection->isSubclassOf(TestClass::BEHAT_CONTEXT); + return $classReflection->is(TestClass::BEHAT_CONTEXT); } }