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

HttpClient   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 38
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
A getGuzzle() 0 4 1
A request() 0 4 1
A post() 0 4 1
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