Syntax

# config/services.yaml
services:
  App\EventListener\MyRequestListener:
    tags:
      - { name: kernel.event_listener }
namespace App\EventListener;
 
use Symfony\Component\HttpKernel\Event\RequestEvent;
 
final class MyRequestListener
{
    public function __invoke(RequestEvent $event): void
    {
        // ...
    }
}