1 | <?php |
||
12 | class OAuth1 implements OAuth1Interface |
||
13 | { |
||
14 | /** |
||
15 | * The HttpClientInterface instance. |
||
16 | * |
||
17 | * @var \Risan\OAuth1\HttpClientInterface |
||
18 | */ |
||
19 | protected $httpClient; |
||
20 | |||
21 | /** |
||
22 | * The RequestFactoryInterface instance. |
||
23 | * |
||
24 | * @var \Risan\OAuth1\Request\RequestFactoryInterface |
||
25 | */ |
||
26 | protected $requestFactory; |
||
27 | |||
28 | /** |
||
29 | * The CredentialsFactoryInterface instance. |
||
30 | * |
||
31 | * @var \Risan\OAuth1\Credentials\CredentialsFactoryInterface |
||
32 | */ |
||
33 | protected $credentialsFactory; |
||
34 | |||
35 | /** |
||
36 | * The TokenCredentials instance. |
||
37 | * |
||
38 | * @var \Risan\OAuth1\Credentials\TokenCredentials |
||
39 | */ |
||
40 | protected $tokenCredentials; |
||
41 | |||
42 | /** |
||
43 | * Create a new OAuth1 instance. |
||
44 | * |
||
45 | * @param \Risan\OAuth1\HttpClientInterface $httpClient |
||
46 | * @param \Risan\OAuth1\Request\RequestFactoryInterface $requestFactory |
||
47 | * @param \Risan\OAuth1\Credentials\CredentialsFactoryInterface $credentialsFactory |
||
48 | */ |
||
49 | 18 | public function __construct(HttpClientInterface $httpClient, RequestFactoryInterface $requestFactory, CredentialsFactoryInterface $credentialsFactory) |
|
50 | { |
||
51 | 18 | $this->httpClient = $httpClient; |
|
52 | 18 | $this->requestFactory = $requestFactory; |
|
53 | 18 | $this->credentialsFactory = $credentialsFactory; |
|
54 | 18 | } |
|
55 | |||
56 | /** |
||
57 | * {@inheritDoc} |
||
58 | */ |
||
59 | 1 | public function getHttpClient() |
|
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | 1 | public function getRequestFactory() |
|
71 | |||
72 | /** |
||
73 | * {@inheritDoc} |
||
74 | */ |
||
75 | 1 | public function getCredentialsFactory() |
|
79 | |||
80 | /** |
||
81 | * {@inheritDoc} |
||
82 | */ |
||
83 | 1 | public function getConfig() |
|
87 | |||
88 | /** |
||
89 | * {@inheritDoc} |
||
90 | */ |
||
91 | 3 | public function getTokenCredentials() |
|
95 | |||
96 | /** |
||
97 | * {@inheritDoc} |
||
98 | */ |
||
99 | 2 | public function setTokenCredentials(TokenCredentials $tokenCredentials) |
|
105 | |||
106 | /** |
||
107 | * {@inheritDoc} |
||
108 | */ |
||
109 | 1 | public function requestTemporaryCredentials() |
|
115 | |||
116 | /** |
||
117 | * {@inheritDoc} |
||
118 | */ |
||
119 | 1 | public function buildAuthorizationUri(TemporaryCredentials $temporaryCredentials) |
|
123 | |||
124 | /** |
||
125 | * {@inheritDoc} |
||
126 | */ |
||
127 | 2 | public function requestTokenCredentials(TemporaryCredentials $temporaryCredentials, $temporaryIdentifier, $verificationCode) |
|
139 | |||
140 | /** |
||
141 | * {@inheritDoc} |
||
142 | */ |
||
143 | 1 | public function get($uri, array $options = []) |
|
147 | |||
148 | /** |
||
149 | * {@inheritDoc} |
||
150 | */ |
||
151 | 1 | public function post($uri, array $options = []) |
|
155 | |||
156 | /** |
||
157 | * {@inheritDoc} |
||
158 | */ |
||
159 | 1 | public function put($uri, array $options = []) |
|
163 | |||
164 | /** |
||
165 | * {@inheritDoc} |
||
166 | */ |
||
167 | 1 | public function patch($uri, array $options = []) |
|
171 | |||
172 | /** |
||
173 | * {@inheritDoc} |
||
174 | */ |
||
175 | 1 | public function delete($uri, array $options = []) |
|
179 | |||
180 | /** |
||
181 | * {@inheritDoc} |
||
182 | */ |
||
183 | 2 | public function request($method, $uri, array $options = []) |
|
193 | } |
||
194 |