1 | <?php |
||
13 | class RequestConfig implements RequestConfigInterface |
||
14 | { |
||
15 | /** |
||
16 | * The ConfigInterface instance. |
||
17 | * |
||
18 | * @var \Risan\OAuth1\ConfigInterface |
||
19 | */ |
||
20 | protected $config; |
||
21 | |||
22 | /** |
||
23 | * The SignerInterface instance. |
||
24 | * |
||
25 | * @var \Risan\OAuth1\Signature\SignerInterface |
||
26 | */ |
||
27 | protected $signer; |
||
28 | |||
29 | /** |
||
30 | * The NonceGeneratorInterface instance. |
||
31 | * |
||
32 | * @var \Risan\OAuth1\Request\NonceGeneratorInterface |
||
33 | */ |
||
34 | protected $nonceGenerator; |
||
35 | |||
36 | /** |
||
37 | * Create RequestBuilder instance. |
||
38 | * |
||
39 | * @param \Risan\OAuth1\ConfigInterface $config |
||
40 | * @param \Risan\OAuth1\Signature\SignerInterface $signer |
||
41 | * @param \Risan\OAuth1\Request\NonceGeneratorInterface $nonceGenerator |
||
42 | */ |
||
43 | 14 | public function __construct(ConfigInterface $config, SignerInterface $signer, NonceGeneratorInterface $nonceGenerator) |
|
53 | |||
54 | /** |
||
55 | * {@inheritDoc} |
||
56 | */ |
||
57 | 1 | public function getConfig() |
|
61 | |||
62 | /** |
||
63 | * {@inheritDoc} |
||
64 | */ |
||
65 | 1 | public function getSigner() |
|
69 | |||
70 | /** |
||
71 | * {@inheritDoc} |
||
72 | */ |
||
73 | 1 | public function getNonceGenerator() |
|
77 | |||
78 | /** |
||
79 | * {@inheritDoc} |
||
80 | */ |
||
81 | 2 | public function getCurrentTimestamp() |
|
85 | |||
86 | /** |
||
87 | * {@inheritDoc} |
||
88 | */ |
||
89 | 1 | public function getTemporaryCredentialsUrl() |
|
93 | |||
94 | /** |
||
95 | * {@inheritDoc} |
||
96 | */ |
||
97 | 1 | public function getTemporaryCredentialsAuthorizationHeader() |
|
109 | |||
110 | /** |
||
111 | * {@inheritDoc} |
||
112 | */ |
||
113 | 1 | public function buildAuthorizationUrl(TemporaryCredentials $temporaryCredentials) |
|
119 | |||
120 | /** |
||
121 | * Get base protocol parameters for the authorization header. |
||
122 | * |
||
123 | * @return array |
||
124 | */ |
||
125 | 1 | public function getBaseProtocolParameters() |
|
135 | |||
136 | /** |
||
137 | * Add signature parameter to the given protocol parameters. |
||
138 | * |
||
139 | * @param array &$parameters |
||
140 | * @param string $uri |
||
141 | * @param string $httpMethod |
||
142 | */ |
||
143 | 1 | public function addSignatureParameter(array &$parameters, $uri, $httpMethod = 'POST') |
|
149 | |||
150 | /** |
||
151 | * Append query parameters to URI. |
||
152 | * |
||
153 | * @param string $uri |
||
154 | * @param array $parameters |
||
155 | * @return string |
||
156 | */ |
||
157 | 2 | public function appendQueryParametersToUri($uri, array $parameters) |
|
167 | |||
168 | /** |
||
169 | * Normalize protocol parameters to be used as authorization header. |
||
170 | * |
||
171 | * @param array $parameters |
||
172 | * @return string |
||
173 | */ |
||
174 | public function normalizeProtocolParameters(array $parameters) |
||
182 | } |
||
183 |