7
7
*/
8
8
class Client
9
9
{
10
-
10
+ /** @var string */
11
11
private $ apiKey ;
12
12
13
+ /** @var RequestHandler */
14
+ public $ requestHandler ;
15
+
13
16
/**
14
17
* Create a new Client
15
18
*
16
19
* @param string $consumerKey the consumer key
17
- * @param string $consumerSecret the consumer secret
18
- * @param string $token oauth token
19
- * @param string $secret oauth token secret
20
+ * @param string|null $consumerSecret the consumer secret
21
+ * @param string|null $token oauth token
22
+ * @param string|null $secret oauth token secret
20
23
*/
21
24
public function __construct ($ consumerKey , $ consumerSecret = null , $ token = null , $ secret = null )
22
25
{
@@ -32,7 +35,8 @@ public function __construct($consumerKey, $consumerSecret = null, $token = null,
32
35
* Set the consumer for this client
33
36
*
34
37
* @param string $consumerKey the consumer key
35
- * @param string $consumerSecret the consumer secret
38
+ * @param string|null $consumerSecret the consumer secret
39
+ * @return void
36
40
*/
37
41
public function setConsumer ($ consumerKey , $ consumerSecret )
38
42
{
@@ -265,7 +269,7 @@ public function getBlogInfo($blogName)
265
269
* @param string $blogName the nae of the blog to look up
266
270
* @param int $size the size to retrieve
267
271
*
268
- * @return string the avatar url
272
+ * @return string|null the avatar url
269
273
*/
270
274
public function getBlogAvatar ($ blogName , $ size = null )
271
275
{
@@ -375,7 +379,7 @@ public function getSubmissionPosts($blogName, $options = null)
375
379
* Make a GET request to the given endpoint and return the response
376
380
*
377
381
* @param string $path the path to call on
378
- * @param array $options the options to call with
382
+ * @param array|null $options the options to call with
379
383
* @param bool $addApiKey whether or not to add the api key
380
384
*
381
385
* @return array the response object (parsed)
@@ -432,10 +436,10 @@ private function parseResponse($response)
432
436
* Make a GET request to the given endpoint and return the response
433
437
*
434
438
* @param string $path the path to call on
435
- * @param array $options the options to call with
439
+ * @param array|null $options the options to call with
436
440
* @param bool $addApiKey whether or not to add the api key
437
441
*
438
- * @return string url redirected to (or null)
442
+ * @return string|null url redirected to (or null)
439
443
*/
440
444
private function getRedirect ($ path , $ options , $ addApiKey )
441
445
{
@@ -452,7 +456,7 @@ private function getRedirect($path, $options, $addApiKey)
452
456
*
453
457
* @param string $method the method to call: GET, POST
454
458
* @param string $path the path to call on
455
- * @param array $options the options to call with
459
+ * @param array|null $options the options to call with
456
460
* @param bool $addApiKey whether or not to add the api key
457
461
*
458
462
* @return \stdClass the response object (not parsed)
0 commit comments