From da6879c9efae9c67f2c48e132fdcc29053fa6432 Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Mon, 1 Jul 2024 10:36:57 +0200 Subject: [PATCH 1/2] fix EventSubscriberInterface type in doc --- docs/rector_rules_overview.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rector_rules_overview.md b/docs/rector_rules_overview.md index 99b88c68..142097e4 100644 --- a/docs/rector_rules_overview.md +++ b/docs/rector_rules_overview.md @@ -82,10 +82,10 @@ Replace EventSubscriberInterface with AsDoctrineListener attribute(s) +use Doctrine\Bundle\DoctrineBundle\Attribute\AsDoctrineListener; use Doctrine\ORM\Event\PrePersistEventArgs; use Doctrine\ORM\Event\PostUpdateEventArgs; --use Doctrine\Common\EventSubscriber; +-use Doctrine\Common\EventSubscriberInterface; use Doctrine\ORM\Events; --class MyEventSubscriber implements EventSubscriber +-class MyEventSubscriber implements EventSubscriberInterface +#[AsDoctrineListener(event: Events::postUpdate)] +#[AsDoctrineListener(event: Events::prePersist)] +class MyEventSubscriber From 344952f15a073cd4a319afe8bf1753ee68fddd4c Mon Sep 17 00:00:00 2001 From: Matthieu Lempereur Date: Sun, 21 Jul 2024 10:01:15 +0200 Subject: [PATCH 2/2] fix EventSubscriberInterface typo in code example --- .../Class_/EventSubscriberInterfaceToAttributeRector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules/Bundle210/Rector/Class_/EventSubscriberInterfaceToAttributeRector.php b/rules/Bundle210/Rector/Class_/EventSubscriberInterfaceToAttributeRector.php index 2850b139..8034d2af 100644 --- a/rules/Bundle210/Rector/Class_/EventSubscriberInterfaceToAttributeRector.php +++ b/rules/Bundle210/Rector/Class_/EventSubscriberInterfaceToAttributeRector.php @@ -46,10 +46,10 @@ public function getRuleDefinition(): RuleDefinition <<<'CODE_SAMPLE' use Doctrine\ORM\Event\PrePersistEventArgs; use Doctrine\ORM\Event\PostUpdateEventArgs; -use Doctrine\Common\EventSubscriber; +use Doctrine\Common\EventSubscriberInterface; use Doctrine\ORM\Events; -class MyEventSubscriber implements EventSubscriber +class MyEventSubscriber implements EventSubscriberInterface { public function getSubscribedEvents() {