Skip to content
This repository has been archived by the owner on Sep 14, 2019. It is now read-only.

Swappable Client Interfaces #15

Open
rossedman opened this issue Dec 10, 2015 · 0 comments
Open

Swappable Client Interfaces #15

rossedman opened this issue Dec 10, 2015 · 0 comments

Comments

@rossedman
Copy link
Owner

Guzzle has recently pushed a big update as well as PSR-7 becoming more widely accepted. Instead of relying solely on Guzzle allow for the option to swap out request clients.

Would mainly effect methods below:

<?php  

namespace Rossedman\Teamwork;

use GuzzleHttp\ClientInterface;
use Rossedman\Teamwork\Contracts\RequestableInterface;

class Client implements RequestableInterface {

    /**
     * @param Guzzle $client
     * @param        $key
     * @param        $url
     */
    public function __construct(ClientInterface $client, $key, $url)
    {
        $this->client = $client;
        $this->key = $key;
        $this->url = $url;
    }

    /**
     * Build Request
     *
     * build up request including authentication, body,
     * and string queries if necessary. This is where the bulk
     * of the data is build up to connect to Teamwork with.
     *
     * @param        $endpoint
     * @param string $action
     * @param array  $params
     *
     * @return $this
     */
    public function buildRequest($endpoint, $action, $params = [], $query = null);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant