Skip to content

[SymfonyCodeQuality] From listener to subscriber#1759

Merged
TomasVotruba merged 1 commit intomasterfrom
subs
Jul 22, 2019
Merged

[SymfonyCodeQuality] From listener to subscriber#1759
TomasVotruba merged 1 commit intomasterfrom
subs

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented Jul 22, 2019

Before

<?php

class SomeListener
{
     public function methodToBeCalled()
     {
     }
}
# config.yaml
services:
    SomeListener:
        tags:
            - { name: kernel.event_listener, event: 'some_event', method: 'methodToBeCalled' }

After

<?php

use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class SomeEventSubscriber implements EventSubscriberInterface
{
     /**
      * @return mixed[]
      */
     public static function getSubscribedEvents(): array
     {
         return ['some_event' => 'methodToBeCalled'];  
     }

     public function methodToBeCalled()
     {
     }
}

@TomasVotruba TomasVotruba force-pushed the subs branch 3 times, most recently from 311cbb4 to f58ac73 Compare July 22, 2019 19:00
@TomasVotruba TomasVotruba merged commit bba9d15 into master Jul 22, 2019
@TomasVotruba TomasVotruba deleted the subs branch July 22, 2019 20:05
TomasVotruba added a commit that referenced this pull request Feb 2, 2022
rectorphp/rector-src@8320d29 [Renaming] Fix duplicate namespacing on RenameNamespaceRector (#1759)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant