Completed
Pull Request — master (#4)
by Risan Bagja
02:18 queued 51s
created

HttpClient::post()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
3
namespace Risan\OAuth1;
4
5
use GuzzleHttp\Client as Guzzle;
6
7
class HttpClient implements HttpClientInterface
8
{
9
    protected $guzzle;
10
11
    /**
12
     * Create an instance of HttpClient.
13
     */
14
    public function __construct(Guzzle $guzzle = null)
15
    {
16
        $this->guzzle = $guzzle === null ? new Guzzle : $guzzle;
17
    }
18
19
    /**
20
     * Get Guzzle client instance.
21
     *
22
     * @return \GuzzleHttp\Client
23
     */
24
    public function getGuzzle()
25
    {
26
        return $this->guzzle;
27
    }
28
29
    /**
30
     * {@inheritDoc}
31
     */
32
    public function request($method, $uri, array $options = [])
33
    {
34
        return $this->guzzle->request($method, $uri, $options);
35
    }
36
37
    /**
38
     * {@inheritDoc}
39
     */
40
    public function post($uri, array $options = [])
41
    {
42
        return $this->request('POST', $uri, $options);
43
    }
44
}
45