Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony] Symfony3 problem z deklaracja serwisu :(, Cannot autowire service "AppBundle\User\FOSUBUserProvide
Lord
post
Post #1





Grupa: Zarejestrowani
Postów: 239
Pomógł: 32
Dołączył: 10.03.2004

Ostrzeżenie: (10%)
X----


  1. my_user_provider:
  2. class: AppBundle\User\FOSUBUserProvider
  3. public: public
  4. #this is the place where the properties are passed to the UserProvider - see config.yml
  5. arguments:
  6. - '@fos_user.user_manager'
  7. - {facebook: facebook_id, google: google_id}



  1. [Symfony\Component\DependencyInjection\Exception\AutowiringFailedException]
  2. Cannot autowire service "AppBundle\User\FOSUBUserProvider": argument "$properties" of method "HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider::__construct()" must have a type-hint
  3. or be given a value explicitly.


Problem tyczy sie 2 argumentu tongue.gif pewnie jest banalny ale nie wiem jak mam to zrobić.

Czytałem, że powinno wyglądać to w ten sposób:

  1. $properties: {facebook: facebook_id, google: google_id}


Ale wtedy nie wiem jak zapisać pierwszy argument sad.gif

Odwołuj się to do:

  1. public function __construct(UserManagerInterface $userManager, array $properties)
  2. {
  3. parent::__construct($userManager, $properties);
  4. }


Ten post edytował Lord 19.09.2017, 14:45:18
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 01:02