Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespace problems on Symfony3 upgrade

I'm currently trying to upgrade my Symfony2 application to Symfony3. I have a SecurityController that overwrites a FOSUserBundle\SecurityController:

namespace Acme\MyBundle\Controller;

use Symfony\Component\DependencyInjection\ContainerAware;

class SecurityController extends ContainerAware
{
    // ...
}

But I get a ClassNotFoundException:

Attempted to load class "ContainerAware" from namespace "Symfony\Component\DependencyInjection".
Did you forget a "use" statement for another namespace?

Are there any changes that I cannot find in the upgrade notes. Can someone point me to a way to come over this?

like image 953
Gottlieb Notschnabel Avatar asked Mar 13 '23 20:03

Gottlieb Notschnabel


1 Answers

Due to the changes from this PR, ContainerAware has been deprecated in 2.8 and removed in 3.0 in favor of ContainerAwareTrait

like image 170
Alexandru Furculita Avatar answered Mar 28 '23 22:03

Alexandru Furculita