*
* @param $timezone The timezone string (e.g. Europe/Berlin)
* @return $success If timezone was accepted
- * @throws NullPointerException If $timezone is NULL
* @throws InvalidArgumentException If $timezone is empty
*/
- public static function setDefaultTimezone ($timezone) {
- // Is it null?
- if (is_null($timezone)) {
- // Throw NPE
- throw new NullPointerException(NULL, BaseFrameworkSystem::EXCEPTION_IS_NULL_POINTER);
- } elseif (!is_string($timezone)) {
- // Is not a string
- throw new InvalidArgumentException(sprintf('timezone[]=%s is not a string', gettype($timezone)));
- } elseif ((is_string($timezone)) && (empty($timezone))) {
+ public static function setDefaultTimezone (string $timezone) {
+ // Is it set?
+ if (empty($timezone)) {
// Entry is empty
throw new InvalidArgumentException('timezone is empty');
}