Last active
October 31, 2019 23:53
-
-
Save ismail1432/5049ce14c02fef20d302fbd5c57964b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface DisableListenerInterface | |
{ | |
public function disable(): void; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Kernel extends BaseKernel | |
{ | |
// ... | |
public function build(ContainerBuilder $container) | |
{ | |
// ... | |
$container->registerForAutoconfiguration(DisableListenerInterface::class) | |
->addTag('kernel.event_listener', ['event' => DisableListenerEvent::NAME, 'method' => 'disable']); | |
} | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooRequestListener implements DisableListenerInterface | |
{ | |
use DisableListenerTrait; | |
// ... | |
} | |
class UserSubscriber implements DisableListenerInterface | |
{ | |
use DisableListenerTrait; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment