You are here

function cf_error_empty_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_empty_string()

Reports that a given argument is supposed to be non-empty 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.

18 calls to cf_error_empty_string()
cf_error_append_history in modules/cf_error/cf_error.module
Appends the function name to the function_history.
cf_error_invalid_array in modules/cf_error/cf_error.module
Reports that a given argument is supposed to be an array but is not.
cf_error_invalid_bool in modules/cf_error/cf_error.module
Reports that a given argument is supposed to be an boolean but is not.
cf_error_invalid_callable in modules/cf_error/cf_error.module
Reports if an argument is not a callable function.
cf_error_invalid_float in modules/cf_error/cf_error.module
Reports if a variable is not a float, double, or real.

... See full list

File

modules/cf_error/cf_error.module, line 233

Code

function cf_error_empty_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 not be an empty string.", array(), $severity);
}