| @@ 7-58 (lines=52) @@ | ||
| 4 | ||
| 5 | use PeeHaa\AsyncTwitter\Api\BaseRequest; |
|
| 6 | ||
| 7 | class MentionsTimeline extends BaseRequest |
|
| 8 | { |
|
| 9 | const METHOD = 'GET'; |
|
| 10 | const ENDPOINT = '/statuses/mentions_timeline.json'; |
|
| 11 | ||
| 12 | public function __construct() |
|
| 13 | { |
|
| 14 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 15 | } |
|
| 16 | ||
| 17 | public function amount(int $amount): MentionsTimeline |
|
| 18 | { |
|
| 19 | $this->parameters['count'] = (string) $amount; |
|
| 20 | ||
| 21 | return $this; |
|
| 22 | } |
|
| 23 | ||
| 24 | public function minimumId(int $id): MentionsTimeline |
|
| 25 | { |
|
| 26 | $this->parameters['since_id'] = (string) $id; |
|
| 27 | ||
| 28 | return $this; |
|
| 29 | } |
|
| 30 | ||
| 31 | public function maximumId(int $id): MentionsTimeline |
|
| 32 | { |
|
| 33 | $this->parameters['max_id'] = (string) $id; |
|
| 34 | ||
| 35 | return $this; |
|
| 36 | } |
|
| 37 | ||
| 38 | public function trimUser(): MentionsTimeline |
|
| 39 | { |
|
| 40 | $this->parameters['trim_user'] = 'true'; |
|
| 41 | ||
| 42 | return $this; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function includeContributorDetails(): MentionsTimeline |
|
| 46 | { |
|
| 47 | $this->parameters['contributor_details'] = 'true'; |
|
| 48 | ||
| 49 | return $this; |
|
| 50 | } |
|
| 51 | ||
| 52 | public function excludeEntities(): MentionsTimeline |
|
| 53 | { |
|
| 54 | $this->parameters['include_entities'] = 'false'; |
|
| 55 | ||
| 56 | return $this; |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| @@ 7-58 (lines=52) @@ | ||
| 4 | ||
| 5 | use PeeHaa\AsyncTwitter\Api\BaseRequest; |
|
| 6 | ||
| 7 | class RetweetsOfMe extends BaseRequest |
|
| 8 | { |
|
| 9 | const METHOD = 'GET'; |
|
| 10 | const ENDPOINT = '/statuses/retweets_of_me.json'; |
|
| 11 | ||
| 12 | public function __construct() |
|
| 13 | { |
|
| 14 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 15 | } |
|
| 16 | ||
| 17 | public function amount(int $amount): RetweetsOfMe |
|
| 18 | { |
|
| 19 | $this->parameters['count'] = (string) $amount; |
|
| 20 | ||
| 21 | return $this; |
|
| 22 | } |
|
| 23 | ||
| 24 | public function minimumId(int $id): RetweetsOfMe |
|
| 25 | { |
|
| 26 | $this->parameters['since_id'] = (string) $id; |
|
| 27 | ||
| 28 | return $this; |
|
| 29 | } |
|
| 30 | ||
| 31 | public function maximumId(int $id): RetweetsOfMe |
|
| 32 | { |
|
| 33 | $this->parameters['max_id'] = (string) $id; |
|
| 34 | ||
| 35 | return $this; |
|
| 36 | } |
|
| 37 | ||
| 38 | public function trimUser(): RetweetsOfMe |
|
| 39 | { |
|
| 40 | $this->parameters['trim_user'] = 'true'; |
|
| 41 | ||
| 42 | return $this; |
|
| 43 | } |
|
| 44 | ||
| 45 | public function excludeEntities(): RetweetsOfMe |
|
| 46 | { |
|
| 47 | $this->parameters['include_entities'] = 'false'; |
|
| 48 | ||
| 49 | return $this; |
|
| 50 | } |
|
| 51 | ||
| 52 | public function excludeUserEntities(): RetweetsOfMe |
|
| 53 | { |
|
| 54 | $this->parameters['include_user_entities'] = 'false'; |
|
| 55 | ||
| 56 | return $this; |
|
| 57 | } |
|
| 58 | } |
|
| 59 | ||
| @@ 7-60 (lines=54) @@ | ||
| 4 | ||
| 5 | use PeeHaa\AsyncTwitter\Api\BaseRequest; |
|
| 6 | ||
| 7 | class Update extends BaseRequest |
|
| 8 | { |
|
| 9 | const METHOD = 'POST'; |
|
| 10 | const ENDPOINT = '/statuses/update.json'; |
|
| 11 | ||
| 12 | public function __construct(string $message) |
|
| 13 | { |
|
| 14 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 15 | ||
| 16 | $this->parameters['status'] = $message; |
|
| 17 | } |
|
| 18 | ||
| 19 | public function replyTo(int $id): Update |
|
| 20 | { |
|
| 21 | $this->parameters['in_reply_to_status_id'] = (string) $id; |
|
| 22 | ||
| 23 | return $this; |
|
| 24 | } |
|
| 25 | ||
| 26 | public function isSensitive(): Update |
|
| 27 | { |
|
| 28 | $this->parameters['possibly_sensitive'] = 'true'; |
|
| 29 | ||
| 30 | return $this; |
|
| 31 | } |
|
| 32 | ||
| 33 | public function setLatitude(float $latitude): Update |
|
| 34 | { |
|
| 35 | $this->parameters['lat'] = (string) $latitude; |
|
| 36 | ||
| 37 | return $this; |
|
| 38 | } |
|
| 39 | ||
| 40 | public function setLongitude(float $longitude): Update |
|
| 41 | { |
|
| 42 | $this->parameters['long'] = (string) $longitude; |
|
| 43 | ||
| 44 | return $this; |
|
| 45 | } |
|
| 46 | ||
| 47 | public function displayCoordinates(): Update |
|
| 48 | { |
|
| 49 | $this->parameters['display_coordinates'] = 'true'; |
|
| 50 | ||
| 51 | return $this; |
|
| 52 | } |
|
| 53 | ||
| 54 | public function trimUser(): Update |
|
| 55 | { |
|
| 56 | $this->parameters['trim_user'] = 'true'; |
|
| 57 | ||
| 58 | return $this; |
|
| 59 | } |
|
| 60 | } |
|
| 61 | ||