Skip to content

Adopt variadic methods throughout because it enforces types. DX #954

Open

Description

@chriscalip

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);

Activity

  1. chriscalip commented on May 9, 2019

    @chriscalip
    Author

    who wants it? will this fly warranting a patch?

  2. chriscalip commented on May 10, 2019

    @chriscalip
    Author

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

  3. atymic commented on Jun 2, 2019

    @atymic
    Member

    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?

  4. added this to the 5.0.0 milestone on Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions