public accountSettingsUpdate ( string[optional] $trendLocationWoeId = null, bool[optional] $sleepTimeEnabled = null, string[optional] $startSleepTime = null, string[optional] $endSleepTime = null, string[optional] $timeZone = null, string[optional] $lang = null ) : array | ||
$trendLocationWoeId | string[optional] | |
$sleepTimeEnabled | bool[optional] | |
$startSleepTime | string[optional] | |
$endSleepTime | string[optional] | |
$timeZone | string[optional] | |
$lang | string[optional] | |
return | array |
public function accountSettingsUpdate($trendLocationWoeId = null, $sleepTimeEnabled = null, $startSleepTime = null, $endSleepTime = null, $timeZone = null, $lang = null)
{
// build parameters
if ($trendLocationWoeId !== null) {
$parameters['trend_location_woeid'] = (string) $trendLocationWoeId;
}
if ($sleepTimeEnabled !== null) {
if ((bool) $sleepTimeEnabled) {
$parameters['sleep_time_enabled'] = 'true';
} else {
$parameters['sleep_time_enabled'] = 'false';
}
}
if ($startSleepTime !== null) {
$parameters['start_sleep_time'] = (string) $startSleepTime;
}
if ($endSleepTime !== null) {
$parameters['end_sleep_time'] = (string) $endSleepTime;
}
if ($timeZone !== null) {
$parameters['time_zone'] = (string) $timeZone;
}
if ($lang !== null) {
$parameters['lang'] = (string) $lang;
}
// make the call
return $this->doCall('account/settings.json', $parameters, true, 'POST');
}
/** * Tests Twitter->accountSettingsUpdate */ public function testAccountSettingsUpdate() { $response = $this->twitter->accountSettingsUpdate(null, null, null, null, null, 'en'); $this->assertArrayHasKey('protected', $response); $this->assertArrayHasKey('screen_name', $response); $this->assertArrayHasKey('discoverable_by_email', $response); $this->assertArrayHasKey('time_zone', $response); $this->assertArrayHasKey('tzinfo_name', $response['time_zone']); $this->assertArrayHasKey('name', $response['time_zone']); $this->assertArrayHasKey('utc_offset', $response['time_zone']); $this->assertArrayHasKey('use_cookie_personalization', $response); $this->assertArrayHasKey('sleep_time', $response); $this->assertArrayHasKey('enabled', $response['sleep_time']); $this->assertArrayHasKey('start_time', $response['sleep_time']); $this->assertArrayHasKey('end_time', $response['sleep_time']); $this->assertArrayHasKey('geo_enabled', $response); $this->assertArrayHasKey('always_use_https', $response); $this->assertArrayHasKey('language', $response); }