isEmpty(); return empty($string); } /** * Check if a string is null or whitespace. * * @param IString|string|null $string String to check for whitespace. * @return bool true if the string is whitespace, false if not. */ public static function nullOrWhitespace(IString|string|null $string): bool { if($string === null) return true; return empty(trim((string)$string)); } }