Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

145
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda