Symfony 4.4 Declaration of ContainerGWHmz1B\srcApp_KernelDevDebugContainer::getParameter(string $name) must be compatible

Viewed 1422

I recently upgraded my project from Symfony 3.4 to 4.4. I am stil working on the upgradation but I am stuck in this Fatal error which says

Compile Error: Declaration of ContainerGWHmz1B\srcApp_KernelDevDebugContainer::getParameter(string $name) must be compatible with Symfony\Component\DependencyInjection\Container::getParameter($name)

This happens when Symfony generates a cache of all the services and classes stored inside /var/cache/dev/ContainerGWHmz1B/srcApp_KernelDevDebugContainer

From the error it totally makes sense because in my compiled container this is the definition

public function getParameter(string $name) while in the Container class which this class extends this is the definition

public function getParameter($name).

The error is quite clear but how can I stop it from happening? Thanks for your help.

0 Answers
Related