File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,6 +129,41 @@ bazinga_geocoder:
129129
130130The `services` key could also be as follows `services : ['@my_geocoder', '@my_geocoder_ii']`. Notice these are the values from the `aliases` key.
131131
132+ # ## Autowiring Providers
133+
134+ If you're using Symfony 4.3 and autowiring you can use bindings provided
135+ the bundle.
136+
137+ ` ` ` yaml
138+ bazinga_geocoder:
139+ providers:
140+ googleMaps:
141+ factory: Bazinga\G eocoderBundle\P roviderFactory\G oogleMapsFactory
142+ ` ` `
143+
144+ ` ` ` php
145+ <?php
146+
147+ namespace App\S ervice;
148+
149+ use Geocoder\P rovider\P rovider;
150+
151+ class MyService
152+ {
153+ private $googleMapsGeocoder;
154+
155+ public function __construct(Provider $googleMapsGeocoder)
156+ {
157+ $this->googleMapsGeocoder = $googleMapsGeocoder;
158+ }
159+ }
160+ ` ` `
161+
162+ Each configured provider has a binding in the following format :
163+ ` providerName + Geocoder` .
164+
165+ In the example we configured provider name as `googleMaps` so the argument is `$googleMapsGeocoder`.
166+
132167# ## Fake local ip
133168
134169You can fake your local IP through this bundle in order to get location
You can’t perform that action at this time.
0 commit comments