public static checkStringLength ( $string, $max_len ) |
public static function checkStringLength($string, $max_len)
{
if (strlen($string) > $max_len) {
throw CouldNotCreateMessage::textExceedsMaximumLength($max_len);
}
return $string;
}
public function setGreetingText($text) { return $this->api->callApi('me/thread_settings', ['setting_type' => 'greeting', 'greeting' => ['text' => MessengerUtils::checkStringEncoding(MessengerUtils::checkStringLength($text, 160), 'UTF-8')]]); }