Find the best Rector rule to solve your problem. Searching through 1007 rules.

Found 2 rules:

EventSubscriberInterfaceToAttributeRector

Replace EventSubscriberInterface with #[AsDoctrineListener] attribute

+use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener;
 use Doctrine\ORM\Event\PrePersistEventArgs;
 use Doctrine\ORM\Event\PostUpdateEventArgs;
-use Doctrine\Common\EventSubscriberInterface;
 use Doctrine\ORM\Events;

-class MyEventSubscriber implements EventSubscriberInterface
+#[AsDoctrineListener(event: Events::postUpdate)]
+#[AsDoctrineListener(event: Events::prePersist)]
+class MyEventSubscriber
 {
-    public function getSubscribedEvents()
-    {
-        return array(
-            Events::postUpdate,
-            Events::prePersist,
-        );
-    }
-
     public function postUpdate(PostUpdateEventArgs $args)
     {
         // ...
     }

     public function prePersist(PrePersistEventArgs $args)
     {
         // ...
     }
 }
PACKAGE:  doctrine/doctrine-bundle >=2.8

AddAnnotationToRepositoryRector

Add @extends ServiceEntityRepository annotation to repository classes that extends ServiceEntityRepository or ServiceDocumentRepository

 use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;

+/**
+ * @extends ServiceEntityRepository<\SomeEntity>
+ */
 final class SomeRepository extends ServiceEntityRepository
 {
     public function __construct(ManagerRegistry $registry)
     {
         parent::__construct($registry, SomeEntity::class);
     }
 }
PACKAGE:  doctrine/doctrine-bundle >=2.3