| @@ 10-69 (lines=60) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/post/account/settings |
|
| 9 | */ |
|
| 10 | class Settings extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'POST'; |
|
| 13 | ||
| 14 | const ENDPOINT = '/account/remove_profile_banner.json'; |
|
| 15 | ||
| 16 | public function __construct() |
|
| 17 | { |
|
| 18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function enableSleepTime(): Settings |
|
| 22 | { |
|
| 23 | $this->parameters['sleep_time_enabled'] = 'true'; |
|
| 24 | ||
| 25 | return $this; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function disableSleepTime(): Settings |
|
| 29 | { |
|
| 30 | $this->parameters['sleep_time_enabled'] = 'false'; |
|
| 31 | ||
| 32 | return $this; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function sleepTimeStart(int $hour): Settings |
|
| 36 | { |
|
| 37 | $this->parameters['start_sleep_time'] = str_pad((string) $hour, 2, '0', STR_PAD_LEFT); |
|
| 38 | ||
| 39 | return $this; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function sleepTimeEnd(int $hour): Settings |
|
| 43 | { |
|
| 44 | $this->parameters['end_sleep_time'] = str_pad((string) $hour, 2, '0', STR_PAD_LEFT); |
|
| 45 | ||
| 46 | return $this; |
|
| 47 | } |
|
| 48 | ||
| 49 | public function timeZone(string $timeZone): Settings |
|
| 50 | { |
|
| 51 | $this->parameters['time_zone'] = $timeZone; |
|
| 52 | ||
| 53 | return $this; |
|
| 54 | } |
|
| 55 | ||
| 56 | public function trendLocationWoeId(int $woeId): Settings |
|
| 57 | { |
|
| 58 | $this->parameters['trend_location_woeid'] = (string) $woeId; |
|
| 59 | ||
| 60 | return $this; |
|
| 61 | } |
|
| 62 | ||
| 63 | public function language(string $language): Settings |
|
| 64 | { |
|
| 65 | $this->parameters['lang'] = $language; |
|
| 66 | ||
| 67 | return $this; |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||
| @@ 10-69 (lines=60) @@ | ||
| 7 | /** |
|
| 8 | * @link https://dev.twitter.com/rest/reference/post/account/update_profile |
|
| 9 | */ |
|
| 10 | class UpdateProfile extends BaseRequest |
|
| 11 | { |
|
| 12 | const METHOD = 'POST'; |
|
| 13 | ||
| 14 | const ENDPOINT = '/account/update_profile.json'; |
|
| 15 | ||
| 16 | public function __construct() |
|
| 17 | { |
|
| 18 | parent::__construct(self::METHOD, self::ENDPOINT); |
|
| 19 | } |
|
| 20 | ||
| 21 | public function name(string $name): UpdateProfile |
|
| 22 | { |
|
| 23 | $this->parameters['name'] = $name; |
|
| 24 | ||
| 25 | return $this; |
|
| 26 | } |
|
| 27 | ||
| 28 | public function url(string $url): UpdateProfile |
|
| 29 | { |
|
| 30 | $this->parameters['url'] = $url; |
|
| 31 | ||
| 32 | return $this; |
|
| 33 | } |
|
| 34 | ||
| 35 | public function sleepTimeStart(int $hour): Settings |
|
| 36 | { |
|
| 37 | $this->parameters['start_sleep_time'] = str_pad((string) $hour, 2, '0', STR_PAD_LEFT); |
|
| 38 | ||
| 39 | return $this; |
|
| 40 | } |
|
| 41 | ||
| 42 | public function sleepTimeEnd(int $hour): Settings |
|
| 43 | { |
|
| 44 | $this->parameters['end_sleep_time'] = str_pad((string) $hour, 2, '0', STR_PAD_LEFT); |
|
| 45 | ||
| 46 | return $this; |
|
| 47 | } |
|
| 48 | ||
| 49 | public function timeZone(string $timeZone): Settings |
|
| 50 | { |
|
| 51 | $this->parameters['time_zone'] = $timeZone; |
|
| 52 | ||
| 53 | return $this; |
|
| 54 | } |
|
| 55 | ||
| 56 | public function trendLocationWoeId(int $woeId): Settings |
|
| 57 | { |
|
| 58 | $this->parameters['trend_location_woeid'] = (string) $woeId; |
|
| 59 | ||
| 60 | return $this; |
|
| 61 | } |
|
| 62 | ||
| 63 | public function language(string $language): Settings |
|
| 64 | { |
|
| 65 | $this->parameters['lang'] = $language; |
|
| 66 | ||
| 67 | return $this; |
|
| 68 | } |
|
| 69 | } |
|
| 70 | ||