Closed Starojitski closed 3 years ago
Hello @Starojitski,
Yep, we know about this problem. You can read more about autowiring in this bundle here: https://github.com/8p/EightPointsGuzzleBundle/blob/master/src/Resources/doc/autowiring-clients.md
I think it's possible to activate autowiring if you have just one client. I will check how to do that. Thanks for idea 👍
Thanks for such fast reply! But the thing is that I had read the resource you refer to and according to it there should not be any need to define services and aliases. Or am i mistaken?
Edit: From what i understood all i had to do was to define a client, which i called default, and that should have been enough
@Starojitski check here: https://github.com/8p/EightPointsGuzzleBundle/blob/master/src/DependencyInjection/EightPointsGuzzleExtension.php#L101
We create alias by type and name. So if you want to autowire by ClientInterface you have to use $defaultClient
name. I will check if we can do it without reserved name and only by type.
Yes, I realize now that I have not actually read the documentation on autowiring, but only looked at the provided code snippets. I wonder whether I am the only one that functions that way.
My apologies and thanks for your patience with me!
Followed installation instructions:
But when running website get the following exception
Defining service and alias helped but would rather not have to do this, if possible. Any advice?
PS, Autowiring
Client
instead ofClientInterface
does work