Find the best Rector rule to solve your problem


ReplaceLifecycleEventArgsByDedicatedEventArgsRector

Replace Doctrine\ORM\Event\LifecycleEventArgs with specific event classes based on the function call

-use Doctrine\ORM\Event\LifecycleEventArgs;
+use Doctrine\ORM\Event\PrePersistEventArgs;

 class PrePersistExample
 {
-    public function prePersist(LifecycleEventArgs $args)
+    public function prePersist(PrePersistEventArgs $args)
     {
         // ...
     }
 }