I use FOSUserBundle in my Symfony site (3.0.6). I recently updated my dependencies with composer, and now I have FOSUserBundle version 2.1.0.
Problem: I overrode the Registration controller (it worked well), but now I have this error when I want to access my Registration page:
Catchable Fatal Error: Argument 1 passed to FOS\UserBundle\Controller\RegistrationController::__construct() must implement interface Symfony\Component\EventDispatcher\EventDispatcherInterface, none given, called in D:\wamp64\www\mySite\var\cache\dev\classes.php on line 2457 and defined 500 Internal Server Error - ContextErrorException
In the Registration controller of FOSUserBundle, these lines have been added:
class RegistrationController extends Controller
{
private $eventDispatcher;
private $formFactory;
private $userManager;
private $tokenStorage;
public function __construct(
EventDispatcherInterface $eventDispatcher,
FactoryInterface $formFactory,
UserManagerInterface $userManager,
TokenStorageInterface $tokenStorage
) {
$this->eventDispatcher = $eventDispatcher;
$this->formFactory = $formFactory;
$this->userManager = $userManager;
$this->tokenStorage = $tokenStorage;
}
// ...
}
In the previous version of the bundle, there was no constructor.
Does anyone have any idea
Thank you in advance.