@@ 10-27 (lines=18) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/application/rate_limit_status |
|
9 | */ |
|
10 | class RateLimitStatus extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | ||
14 | const ENDPOINT = '/application/rate_limit_status.json'; |
|
15 | ||
16 | public function __construct() |
|
17 | { |
|
18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
19 | } |
|
20 | ||
21 | public function filterResources(array $resources): RateLimitStatus |
|
22 | { |
|
23 | $this->parameters['resources'] = implode(',', $resources); |
|
24 | ||
25 | return $this; |
|
26 | } |
|
27 | } |
|
28 |
@@ 10-22 (lines=13) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/collections/show |
|
9 | */ |
|
10 | class Show extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | ||
14 | const ENDPOINT = '/collections/show.json'; |
|
15 | ||
16 | public function __construct(string $id) |
|
17 | { |
|
18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
19 | ||
20 | $this->parameters['id'] = $id; |
|
21 | } |
|
22 | } |
|
23 |
@@ 10-22 (lines=13) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/direct_messages/show |
|
9 | */ |
|
10 | class Show extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | ||
14 | const ENDPOINT = '/direct_messages/show.json'; |
|
15 | ||
16 | public function __construct(int $id) |
|
17 | { |
|
18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
19 | ||
20 | $this->parameters['id'] = (string) $id; |
|
21 | } |
|
22 | } |
|
23 |
@@ 10-27 (lines=18) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/friendships/no_retweets/ids |
|
9 | */ |
|
10 | class Ids extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | ||
14 | const ENDPOINT = '/friendships/no_retweets/ids.json'; |
|
15 | ||
16 | public function __construct() |
|
17 | { |
|
18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
19 | } |
|
20 | ||
21 | public function stringifyIds(): Ids |
|
22 | { |
|
23 | $this->parameters['stringify_ids'] = 'true'; |
|
24 | ||
25 | return $this; |
|
26 | } |
|
27 | } |
|
28 |
@@ 10-26 (lines=17) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/lists/list |
|
9 | */ |
|
10 | abstract class Lists extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | const ENDPOINT = '/lists/list.json'; |
|
14 | ||
15 | public function __construct() |
|
16 | { |
|
17 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
18 | } |
|
19 | ||
20 | public function reverse(): Lists |
|
21 | { |
|
22 | $this->parameters['reverse'] = 'true'; |
|
23 | ||
24 | return $this; |
|
25 | } |
|
26 | } |
|
27 |
@@ 10-26 (lines=17) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/post/statuses/destroy/id |
|
9 | */ |
|
10 | class Destroy extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'POST'; |
|
13 | const ENDPOINT = '/statuses/destroy/%s.json'; |
|
14 | ||
15 | public function __construct(int $id) |
|
16 | { |
|
17 | parent::__construct(self::METHOD, sprintf(self::ENDPOINT, $id)); |
|
18 | } |
|
19 | ||
20 | public function trimUser(): Destroy |
|
21 | { |
|
22 | $this->parameters['trim_user'] = 'true'; |
|
23 | ||
24 | return $this; |
|
25 | } |
|
26 | } |
|
27 |
@@ 10-26 (lines=17) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/post/statuses/retweet/id |
|
9 | */ |
|
10 | class Retweet extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'POST'; |
|
13 | const ENDPOINT = '/statuses/retweet/%s.json'; |
|
14 | ||
15 | public function __construct(int $id) |
|
16 | { |
|
17 | parent::__construct(self::METHOD, sprintf(self::ENDPOINT, $id)); |
|
18 | } |
|
19 | ||
20 | public function trimUser(): Retweet |
|
21 | { |
|
22 | $this->parameters['trim_user'] = 'true'; |
|
23 | ||
24 | return $this; |
|
25 | } |
|
26 | } |
|
27 |
@@ 10-26 (lines=17) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/post/statuses/unretweet/id |
|
9 | */ |
|
10 | class UnRetweet extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'POST'; |
|
13 | const ENDPOINT = '/statuses/unretweet/%s.json'; |
|
14 | ||
15 | public function __construct(int $id) |
|
16 | { |
|
17 | parent::__construct(self::METHOD, sprintf(self::ENDPOINT, $id)); |
|
18 | } |
|
19 | ||
20 | public function trimUser(): UnRetweet |
|
21 | { |
|
22 | $this->parameters['trim_user'] = 'true'; |
|
23 | ||
24 | return $this; |
|
25 | } |
|
26 | } |
|
27 |
@@ 10-22 (lines=13) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/trends/closest |
|
9 | */ |
|
10 | class Closest extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | const ENDPOINT = '/trends/closest.json'; |
|
14 | ||
15 | public function __construct(string $latitude, string $longitude) |
|
16 | { |
|
17 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
18 | ||
19 | $this->parameters['lat'] = $latitude; |
|
20 | $this->parameters['long'] = $longitude; |
|
21 | } |
|
22 | } |
|
23 |
@@ 10-26 (lines=17) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/users/suggestions |
|
9 | */ |
|
10 | class Suggestion extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | const ENDPOINT = '/users/suggestions.json'; |
|
14 | ||
15 | public function __construct() |
|
16 | { |
|
17 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
18 | } |
|
19 | ||
20 | public function lang(string $lang): Suggestion |
|
21 | { |
|
22 | $this->parameters['lang'] = $lang; |
|
23 | ||
24 | return $this; |
|
25 | } |
|
26 | } |
|
27 |
@@ 10-26 (lines=17) @@ | ||
7 | /** |
|
8 | * @link https://dev.twitter.com/rest/reference/get/users/suggestions/slug |
|
9 | */ |
|
10 | class Slug extends BaseRequest |
|
11 | { |
|
12 | const METHOD = 'GET'; |
|
13 | const ENDPOINT = '/users/suggestions/%s.json'; |
|
14 | ||
15 | public function __construct(string $slug) |
|
16 | { |
|
17 | parent::__construct(self::METHOD, sprintf(self::ENDPOINT, $slug)); |
|
18 | } |
|
19 | ||
20 | public function lang(string $lang): Slug |
|
21 | { |
|
22 | $this->parameters['lang'] = $lang; |
|
23 | ||
24 | return $this; |
|
25 | } |
|
26 | } |
|
27 |