Skip to content

Use Symfony/options-resolver #421

Closed
Closed

Description

@Nyholm

Since #419 we have 3 constructor arguments. It is likely that a new feature will require a 4th one. It could be better to use an array instead. Especially for string/bool arguments.

$client = new Client($httpClient, ['api_version'=>'s2', 'enterprice_url'=>'foobar'])

These should be validated with the symfony option resolver and then stored an separate instance variables (like today)

Activity

  1. GrahamCampbell commented on Aug 1, 2016

    @GrahamCampbell
    Contributor

    Nah, I think that's overkill, and we'd likely want to avoid adding more stuff to the constructor anyway. I can't think of any use cases?

  2. Nyholm commented on Aug 1, 2016

    @Nyholm
    CollaboratorAuthor

    It may be overkill. But it is more future proof. Maybe this can be saved to 3.0 if we notice that we have 5+ constructor arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions