/** * verifica se a chave informada e valida e a retorna * * @param string $key * @return string * @throws IllegalArgumentException * */ public static function isValidKey($key) { $key = trim($key); if (!$key) { throw IllegalArgumentException::argumentCantBeNULL("key: {$key}"); } return $key; }