Geocoder icon indicating copy to clipboard operation
Geocoder copied to clipboard

Adopt variadic methods throughout because it enforces types. DX

Open chriscalip opened this issue 6 years ago • 3 comments

example adoption:

From BeforeAdoption. a.) class: Geocoder\ProviderAggregator b.) method def: registerProviders(array $providers = []); c.) sample method call: $geocoder->registerProviders([new \Geocoder\Provider\GoogleMaps\GoogleMaps($adapter), new \Geocoder\Provider\Yandex\Yandex($adapter),]);

To AfterAdoption. a.) class: Geocoder\ProviderAggregator b.) method def: registerProviders(Providers ...$providers); c.) method call: $geocoder->registerProviders(new \Geocoder\Provider\GoogleMaps\GoogleMaps($adapter)); d.) method call: $geocoder->registerProviders(new \Geocoder\Provider\GoogleMaps\GoogleMaps($adapter), new XXProvider); e.) method call: $providers = [new \Geocoder\Provider\GoogleMaps\GoogleMaps($adapter), new \Geocoder\Provider\Yandex\Yandex($adapter),]; $geocoder->registerProviders(... $providers);

chriscalip avatar May 09 '19 23:05 chriscalip

who wants it? will this fly warranting a patch?

chriscalip avatar May 09 '19 23:05 chriscalip

Throwing it out there that this issue is BC and thus is fair to punt to a future discussion.

chriscalip avatar May 10 '19 02:05 chriscalip

I guess this would have to be a 5.x.x feature due to the BC break. Maybe worth revisiting if/when works begins on it?

atymic avatar Jun 02 '19 01:06 atymic