Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

144
Vistas
Symfony ResponseEvent arguments

I'm following a Symfony tutorial and am currently on The Event Dispatcher section. In the first code block (after the composer part) I'm instructed to set up the dispatcher

// dispatch a response event
$this->dispatcher->dispatch(new ResponseEvent($response, $request), 'response');

I'm using PHPStorm, and when I create the ResponseEvent class it is asking for 4 arguments

new ResponseEvent($kernel, $request, $requestType, $response)

While I could create a $kernel element by importing the HttpKernelInterface, I'm unsure if this is correct.

I also have no idea where to get the $requestType from, since the ResponseEvent class definition says that this should be of type int and I only know of request types in string format (e.g. 'GET', 'POST' etc).

Here is the full file in case I have made a mistake elsewhere.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The tutorial that you are following wants you to use the Simplex ResponseEvent, that method signature is for the kernel ResponseEvent

At the top of your file you should see something like this:

use Symfony\Component\HttpKernel\Event\ResponseEvent;

Replace it with

use Simplex\ResponseEvent;
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda