Completed
Push — master ( c09200...3535c2 )
by Ryosuke
02:28
created

Client   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 5

Importance

Changes 4
Bugs 2 Features 0
Metric Value
wmc 6
c 4
b 2
f 0
lcom 3
cbo 5
dl 0
loc 48
rs 10

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getInternalCredential() 0 4 1
A getInternalOptions() 0 4 1
A getInternalCurl() 0 4 1
A setInternalCredential() 0 4 1
A setInternalOptions() 0 4 1
A setInternalCurl() 0 4 1
1
<?php
2
3
namespace mpyw\Cowitter;
4
5
use mpyw\Cowitter\Components\Credential;
6
use mpyw\Cowitter\Components\CurlInitializer;
7
8
class Client implements \ArrayAccess, ClientInterface
9
{
10
    protected static $defaultOptions = [
11
        CURLOPT_CONNECTTIMEOUT => 10,
12
        CURLOPT_TIMEOUT        => 20,
13
        CURLOPT_ENCODING       => 'gzip',
14
    ];
15
16
    protected $credential;
17
    protected $options;
18
    protected $curl;
19
20
    use \mpyw\Cowitter\Traits\BaseClientTrait;
21
    use \mpyw\Cowitter\Traits\AuthenticatorTrait;
22
    use \mpyw\Cowitter\Traits\RequestorTrait;
23
    use \mpyw\Cowitter\Traits\UploaderTrait;
24
    use \mpyw\Cowitter\Traits\OAuth2ClientTrait;
25
26
    protected function getInternalCredential()
27
    {
28
        return $this->credential;
29
    }
30
31
    protected function getInternalOptions()
32
    {
33
        return $this->options;
34
    }
35
36
    protected function getInternalCurl()
37
    {
38
        return $this->curl;
39
    }
40
41
    protected function setInternalCredential(Credential $credential)
42
    {
43
        return $this->credential = $credential;
44
    }
45
46
    protected function setInternalOptions(array $options)
47
    {
48
        return $this->options = $options;
49
    }
50
51
    protected function setInternalCurl(CurlInitializer $curl)
52
    {
53
        return $this->curl = $curl;
54
    }
55
}
56