Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

147
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!