Answer the question
In order to leave comments, you need to log in
Why is Container not being passed to the constructor?
Simfa throws an error:
ContextErrorException: Catchable Fatal Error: Argument 1 passed to Uasector\UserBundle\UserProvider\AbstractSocialNetworkProvider::__construct() must be an instance of Symfony\Component\DependencyInjection\Container, none given, called in /Users/roman/Development/Sites/uasector.dev/app/cache/dev/appDevDebugProjectContainer.php on line 5846 and defined in /Users/roman/Development/Sites/uasector.dev/src/Uasector/UserBundle/UserProvider/AbstractSocialNetworkProvider.php line 33
public function __construct(Container $container, $kernelWebDir, $uploadDir, $defaultAvatarPath)
services:
uasector_user.uasector_abstract_user_data_service:
class: %uasector.user.abstract_social_network_provider.class%
arguments: ['@service_container', '%kernel.root_dir%', '%uasector_user.image.upload_directory%', '%uasector_user.image.default_avatar_path%']
Answer the question
In order to leave comments, you need to log in
Forgive my ignorance, but why are you shoving the entire container into the service? This is not good. The only justification for this is cyclical dependencies, which, as it were, is bad, but sometimes it happens.
You have something like "abstract class AbstractSocialNetworkProvider". The point is that you shouldn't try to call the constructor of an abstract class. And it's strange that the symphony swears at types ... show
I'm wondering what's in there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question