my_user_provider:
class: AppBundle\User\FOSUBUserProvider
public: public
#this is the place where the properties are passed to the UserProvider - see config.yml
arguments:
- '@fos_user.user_manager'
- {facebook: facebook_id, google: google_id}
[Symfony\Component\DependencyInjection\Exception\AutowiringFailedException]
Cannot autowire service "AppBundle\User\FOSUBUserProvider": argument "$properties" of method "HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider::__construct()" must have a type-hint
or be given a value explicitly.
Problem tyczy sie 2 argumentu

pewnie jest banalny ale nie wiem jak mam to zrobić.
Czytałem, że powinno wyglądać to w ten sposób:
$properties: {facebook: facebook_id, google: google_id}
Ale wtedy nie wiem jak zapisać pierwszy argument

Odwołuj się to do:
public function __construct
(UserManagerInterface
$userManager, array $properties) {
parent::__construct($userManager, $properties);
}
Ten post edytował Lord 19.09.2017, 14:45:18