Skip to content

Instantly share code, notes, and snippets.

@ismail1432
Last active October 31, 2019 23:53
Show Gist options
  • Save ismail1432/5049ce14c02fef20d302fbd5c57964b1 to your computer and use it in GitHub Desktop.
Save ismail1432/5049ce14c02fef20d302fbd5c57964b1 to your computer and use it in GitHub Desktop.
<?php
interface DisableListenerInterface
{
public function disable(): void;
}
<?php
class Kernel extends BaseKernel
{
// ...
public function build(ContainerBuilder $container)
{
// ...
$container->registerForAutoconfiguration(DisableListenerInterface::class)
->addTag('kernel.event_listener', ['event' => DisableListenerEvent::NAME, 'method' => 'disable']);
}
}
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