1 | <?php |
||
8 | class Config implements ConfigInterface |
||
9 | { |
||
10 | /** |
||
11 | * The ClientCredentials instance. |
||
12 | * |
||
13 | * @var \Risan\OAuth1\Credentials\ClientCredentials |
||
14 | */ |
||
15 | protected $clientCredentials; |
||
16 | |||
17 | /** |
||
18 | * The callback URI. |
||
19 | * |
||
20 | * @var string|null |
||
21 | */ |
||
22 | protected $callbackUri; |
||
23 | |||
24 | /** |
||
25 | * The URL for obtaining temporary credentials. Also known as request token |
||
26 | * URL. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | protected $temporaryCredentialsUrl; |
||
31 | |||
32 | /** |
||
33 | * The URL for asking user to authorize the request. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | protected $authorizationUrl; |
||
38 | |||
39 | /** |
||
40 | * The URL for obtaining token credentials. Also known as access token URL. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | protected $tokenCredentialsUrl; |
||
45 | |||
46 | /** |
||
47 | * Create new instance of Config class. |
||
48 | * |
||
49 | * @param \Risan\OAuth1\Credentials\ClientCredentials $clientCredentials |
||
50 | * @param string $temporaryCredentialsUrl |
||
51 | * @param string $authorizationUrl |
||
52 | * @param string $tokenCredentialsUrl |
||
53 | * @param string|null $callbackUri |
||
54 | */ |
||
55 | 18 | public function __construct(ClientCredentials $clientCredentials, $temporaryCredentialsUrl, $authorizationUrl, $tokenCredentialsUrl, $callbackUri = null) |
|
63 | |||
64 | /** |
||
65 | * {@inheritDoc} |
||
66 | */ |
||
67 | 6 | public function getClientCredentials() |
|
71 | |||
72 | /** |
||
73 | * {@inheritDoc} |
||
74 | */ |
||
75 | 2 | public function getClientCredentialsIdentifier() |
|
79 | |||
80 | /** |
||
81 | * {@inheritDoc} |
||
82 | */ |
||
83 | 2 | public function getClientCredentialsSecret() |
|
87 | |||
88 | /** |
||
89 | * {@inheritDoc} |
||
90 | */ |
||
91 | 1 | public function hasCallbackUri() |
|
95 | |||
96 | /** |
||
97 | * {@inheritDoc} |
||
98 | */ |
||
99 | 3 | public function getCallbackUri() |
|
103 | |||
104 | /** |
||
105 | * {@inheritDoc} |
||
106 | */ |
||
107 | 2 | public function getTemporaryCredentialsUrl() |
|
111 | |||
112 | /** |
||
113 | * {@inheritDoc} |
||
114 | */ |
||
115 | 2 | public function getAuthorizationUrl() |
|
119 | |||
120 | /** |
||
121 | * {@inheritDoc} |
||
122 | */ |
||
123 | 2 | public function getTokenCredentialsUrl() |
|
127 | |||
128 | /** |
||
129 | * {@inheritDoc} |
||
130 | */ |
||
131 | 9 | public static function createFromArray(array $config) |
|
157 | } |
||
158 |