Skip to content

Use dependency injection #73

@aik099

Description

@aik099

Right now the pull model (the service factory) is used instead of push model (dependency injection). The only service that is available right now is CurlService and it's used in 2 classes only:

  • AbstractWebDriver
  • SauceRest

Proposing to:

  1. add an optional $curlService argument to constructor of mentioned classes
  2. when not given use service factory to create it
  3. add $defaultOptions constructor parameter to existing CurlService class, that would be stored as class property
  4. the CurlService::execute method would merge $defaultOptions property with $extraOptions method argument to get final list of curl options for a request

This would both preserve BC and make replacement of CurlService straight forward.

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