Where do extra parameters come from?
This is a feature provided by Symfony:


  The Request object as a Controller Argument
  
  What if you need to read query parameters, grab a request header or get access to an uploaded file? All of that information is stored in Symfony's Request object. To get it in your controller, just add it as an argument and type-hint it with the Request class:

use Symfony\Component\HttpFoundation\Request;

public function indexAction(Request $request, $firstName, $lastName)
{
  $page = $request-&gt;query-&gt;get('page', 1);

  // ...
}