| @@ 10-41 (lines=32) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/get/blocks/list |
|
| 9 | */ |
|
| 10 | class Collection extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'GET'; |
|
| 13 | ||
| 14 | const ENDPOINT = '/blocks/list.json'; |
|
| 15 | ||
| 16 | public function __construct() |
|
| 17 | { |
|
| 18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function excludeEntities(): Collection |
|
| 22 | { |
|
| 23 | $this->parameters['include_entities'] = 'false'; |
|
| 24 | ||
| 25 | return $this; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function skipStatus(): Collection |
|
| 29 | { |
|
| 30 | $this->parameters['skip_status'] = 'true'; |
|
| 31 | ||
| 32 | return $this; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function fromCursor(int $cursor): Collection |
|
| 36 | { |
|
| 37 | $this->parameters['cursor'] = (string) $cursor; |
|
| 38 | ||
| 39 | return $this; |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||
| @@ 10-42 (lines=33) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/get/statuses/show/id |
|
| 9 | */ |
|
| 10 | class Show extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'GET'; |
|
| 13 | const ENDPOINT = '/statuses/show.json'; |
|
| 14 | ||
| 15 | public function __construct(int $id) |
|
| 16 | { |
|
| 17 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 18 | ||
| 19 | $this->parameters['id'] = (string) $id; |
|
| 20 | } |
|
| 21 | ||
| 22 | public function trimUser(): Show |
|
| 23 | { |
|
| 24 | $this->parameters['trim_user'] = 'true'; |
|
| 25 | ||
| 26 | return $this; |
|
| 27 | } |
|
| 28 | ||
| 29 | public function excludeEntities(): Show |
|
| 30 | { |
|
| 31 | $this->parameters['include_entities'] = 'false'; |
|
| 32 | ||
| 33 | return $this; |
|
| 34 | } |
|
| 35 | ||
| 36 | public function includeUserRetweetStatus(): Show |
|
| 37 | { |
|
| 38 | $this->parameters['include_my_retweet'] = 'true'; |
|
| 39 | ||
| 40 | return $this; |
|
| 41 | } |
|
| 42 | } |
|
| 43 | ||
| @@ 10-48 (lines=39) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/get/lists/members |
|
| 9 | */ |
|
| 10 | abstract class Member extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'GET'; |
|
| 13 | ||
| 14 | const ENDPOINT = '/lists/members.json'; |
|
| 15 | ||
| 16 | public function __construct() |
|
| 17 | { |
|
| 18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function amount(int $amount): Member |
|
| 22 | { |
|
| 23 | $this->parameters['count'] = (string) $amount; |
|
| 24 | ||
| 25 | return $this; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function fromCursor(int $cursor): Member |
|
| 29 | { |
|
| 30 | $this->parameters['cursor'] = (string) $cursor; |
|
| 31 | ||
| 32 | return $this; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function excludeEntities(): Member |
|
| 36 | { |
|
| 37 | $this->parameters['include_entities'] = 'false'; |
|
| 38 | ||
| 39 | return $this; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function skipStatus(): Member |
|
| 43 | { |
|
| 44 | $this->parameters['skip_status'] = 'true'; |
|
| 45 | ||
| 46 | return $this; |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| @@ 10-48 (lines=39) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/get/lists/members/show |
|
| 9 | */ |
|
| 10 | abstract class Show extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'GET'; |
|
| 13 | ||
| 14 | const ENDPOINT = '/lists/members/show.json'; |
|
| 15 | ||
| 16 | public function __construct() |
|
| 17 | { |
|
| 18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function amount(int $amount): Show |
|
| 22 | { |
|
| 23 | $this->parameters['count'] = (string) $amount; |
|
| 24 | ||
| 25 | return $this; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function fromCursor(int $cursor): Show |
|
| 29 | { |
|
| 30 | $this->parameters['cursor'] = (string) $cursor; |
|
| 31 | ||
| 32 | return $this; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function includeEntities(): Show |
|
| 36 | { |
|
| 37 | $this->parameters['include_entities'] = 'true'; |
|
| 38 | ||
| 39 | return $this; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function skipStatus(): Show |
|
| 43 | { |
|
| 44 | $this->parameters['skip_status'] = 'true'; |
|
| 45 | ||
| 46 | return $this; |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| @@ 10-40 (lines=31) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/get/mutes/users/list |
|
| 9 | */ |
|
| 10 | class Lists extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'GET'; |
|
| 13 | const ENDPOINT = '/mutes/users/list.json'; |
|
| 14 | ||
| 15 | public function __construct() |
|
| 16 | { |
|
| 17 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 18 | } |
|
| 19 | ||
| 20 | public function cursor(int $cursor): Lists |
|
| 21 | { |
|
| 22 | $this->parameters['cursor'] = (string)$cursor; |
|
| 23 | ||
| 24 | return $this; |
|
| 25 | } |
|
| 26 | ||
| 27 | public function excludeEntities(): Lists |
|
| 28 | { |
|
| 29 | $this->parameters['include_entities'] = 'false'; |
|
| 30 | ||
| 31 | return $this; |
|
| 32 | } |
|
| 33 | ||
| 34 | public function skipStatus(): Lists |
|
| 35 | { |
|
| 36 | $this->parameters['skip_status'] = 'true'; |
|
| 37 | ||
| 38 | return $this; |
|
| 39 | } |
|
| 40 | } |
|
| 41 | ||
| @@ 10-41 (lines=32) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/get/account/verify_credentials |
|
| 9 | */ |
|
| 10 | class VerifyCredentials extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'GET'; |
|
| 13 | ||
| 14 | const ENDPOINT = '/account/verify_credentials.json'; |
|
| 15 | ||
| 16 | public function __construct() |
|
| 17 | { |
|
| 18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function excludeEntities(): VerifyCredentials |
|
| 22 | { |
|
| 23 | $this->parameters['include_entities'] = 'false'; |
|
| 24 | ||
| 25 | return $this; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function skipStatus(): VerifyCredentials |
|
| 29 | { |
|
| 30 | $this->parameters['skip_status'] = 'true'; |
|
| 31 | ||
| 32 | return $this; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function includeEmail(): VerifyCredentials |
|
| 36 | { |
|
| 37 | $this->parameters['include_email'] = 'true'; |
|
| 38 | ||
| 39 | return $this; |
|
| 40 | } |
|
| 41 | } |
|
| 42 | ||