Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SymfonyCodeQuality] From listener to subscriber #1759

Merged
merged 1 commit into from
Jul 22, 2019
Merged

[SymfonyCodeQuality] From listener to subscriber #1759

merged 1 commit into from
Jul 22, 2019

Conversation

TomasVotruba
Copy link
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