1 | <?php |
||
19 | class ImgurClient |
||
20 | { |
||
21 | /** |
||
22 | * Client ID, received after registering Imgur Application |
||
23 | * |
||
24 | * @see https://api.imgur.com/oauth2/addclient |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $clientId; |
||
28 | |||
29 | /** |
||
30 | * Client Secret token, received after registering Imgur Application |
||
31 | * |
||
32 | * @see https://api.imgur.com/oauth2/addclient |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $clientSecret; |
||
36 | |||
37 | /** |
||
38 | * Mashape key (used for commercial products) |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $mashapeKey; |
||
43 | |||
44 | /** |
||
45 | * Object, containing Imgur access token, which is used to access users private data |
||
46 | * |
||
47 | * @var TokenInterface; |
||
48 | */ |
||
49 | protected $token; |
||
50 | |||
51 | /** |
||
52 | * Service container |
||
53 | * |
||
54 | * @var Container |
||
55 | */ |
||
56 | protected $container; |
||
57 | |||
58 | /** |
||
59 | * Client constructor. |
||
60 | * |
||
61 | * @param string $clientId |
||
62 | * @param string $clientSecret |
||
63 | * @param string $mashapeKey |
||
64 | */ |
||
65 | public function __construct( |
||
78 | |||
79 | /** |
||
80 | * Set client id |
||
81 | * |
||
82 | * @param string $clientId |
||
83 | * @return $this |
||
84 | */ |
||
85 | public function setClientId($clientId) |
||
91 | |||
92 | /** |
||
93 | * Get client Id |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | public function getClientId() |
||
101 | |||
102 | /** |
||
103 | * Set client secret |
||
104 | * |
||
105 | * @param string $clientSecret |
||
106 | * @return $this |
||
107 | */ |
||
108 | public function setClientSecret($clientSecret) |
||
114 | |||
115 | /** |
||
116 | * Get client secret |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getClientSecret() |
||
124 | |||
125 | /** |
||
126 | * Set Mashape key |
||
127 | * |
||
128 | * @param string $mashapeKey |
||
129 | * @return $this |
||
130 | */ |
||
131 | public function setMashapeKey($mashapeKey) |
||
137 | |||
138 | /** |
||
139 | * Get Mashape key |
||
140 | * |
||
141 | * @return mixed |
||
142 | */ |
||
143 | public function getMashapeKey() |
||
147 | |||
148 | /** |
||
149 | * @param TokenInterface $token |
||
150 | * @return $this |
||
151 | */ |
||
152 | public function setToken(TokenInterface $token) |
||
158 | |||
159 | /** |
||
160 | * @return TokenInterface |
||
161 | */ |
||
162 | public function getToken() |
||
166 | |||
167 | /** |
||
168 | * Get authorization handler |
||
169 | * |
||
170 | * @return AuthorizationHandlerInterface |
||
171 | */ |
||
172 | public function getAuthorizationHandler() |
||
176 | |||
177 | /** |
||
178 | * Image API endpoint |
||
179 | * |
||
180 | * @see Mechpave\ImgurClient\Api\Image |
||
181 | * @return Image |
||
182 | */ |
||
183 | public function image() |
||
187 | |||
188 | /** |
||
189 | * Album API endpoint |
||
190 | * |
||
191 | * @see Mechpave\ImgurClient\Api\Image |
||
192 | * @return Album |
||
193 | */ |
||
194 | public function album() |
||
198 | |||
199 | /** |
||
200 | * Initializes service container |
||
201 | * @see http://symfony.com/doc/current/components/dependency_injection/index.html |
||
202 | */ |
||
203 | protected function initializeContainer() |
||
219 | } |