You are here

function cf_error_not_string in Common Functionality 7

Same name and namespace in other branches
  1. 7.2 modules/cf_1x_compatibility/cf_1x_compatibility.module \cf_error_not_string()

Reports that a given argument is supposed to be a string but is not.

Why: See reason from cf_error_invalid_variable() function.

Parameters

array $function_history: An array of function names, ie: array('0' => 'my_function_name').

string $argument_name: The variable name of the argument in question.

int $severity: (optional) This is passed directly to watchdog and represents the severity of the report.

2 calls to cf_error_not_string()
cf_http_reduce_html_headers in modules/cf_http/cf_http.module
Reads and processes a website page at the given path.
cf_is_empty_or_non_string in ./cf.module
Checks if a variable is an empty string is empty or not a string at all.

File

modules/cf_error/cf_error.module, line 208

Code

function cf_error_not_string($function_history, $argument_name, $severity = WATCHDOG_ERROR) {
  cf_error_append_history($function_history, __FUNCTION__);
  if ($argument_name == '') {
    cf_error_empty_string($function_history, 'argument_name');
  }
  cf_error_invalid_variable($function_history, $argument_name, "Must be a string.", array(), $severity);
}