Q:

Symfony4 Expected String but got String

I have this error everywhere in my Controller where I "render" or I access a variable through a getParameter:

expected "\Symfony\Bundle\FrameworkBundle\Controller\string" got string

What's wrong?

A:

It is not an error of your code, it's a error on your IDE, I assume that you are using PHPStorm, go to File > Invalidate Caches/ Restart .. that should solve it.

