Skip to content

HTTPClient injection through constructor is wrongfully reused #29

Closed
@SpacePossum

Description

@SpacePossum

When construction the client you can only pass one HTTPClient; @ see
https://github.com/messagebird/php-rest-api/blob/master/src/MessageBird/Client.php#L95
The client is used for both chat and messaging while the services have diff. end-points.

I would like to suggest to add an additional parameter to the constructor allowing two HTTPClient's to be passed, i.e. something like this;

public function __construct($accessKey = null, Common\HttpClient $httpClient = null, Common\HttpClient $httpChatClient = null)

Since the class is not declared final the change would be a BC break, so I would like to suggest doing the change on a new 2.x line and release the change on a 2.0 tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions