public static function cf_error::invalid_bool in Common Functionality 7.2
Reports that a given argument is supposed to be an boolean but is not.
@see: watchdog() @see: watchdog_severity_levels()
Parameters
string $argument_names: The variable name of the argument in question.
int $severity: (optional) The severity of the message, as per RFC 3164. Possible values are WATCHDOG_ERROR, WATCHDOG_WARNING, etc.
Return value
cf_error_code A object containing the processed error, with specified backtrace.
5 calls to cf_error::invalid_bool()
- cf_dom::remove_element in modules/
cf_dom/ classes/ cf_dom.php - Removes the given element from its parent.
- cf_dom::remove_elements in modules/
cf_dom/ classes/ cf_dom.php - Remove all elements of a given element type.
- cf_dom::__construct in modules/
cf_dom/ classes/ cf_dom.php - Constructor for the cf_dom class.
- cf_error_invalid_bool in modules/
cf_1x_compatibility/ cf_1x_compatibility.module - This is a compatibility function for cf-1.x.
- cf_version_exists in ./
cf.module - Detect if a specific version of a module exists.
File
- modules/
cf_error/ classes/ cf_error.php, line 541 - Provides the derror exception class.
Class
Code
public static function invalid_bool($argument_name, $severity = WATCHDOG_ERROR) {
$error = new cf_error_code();
if (empty($argument_name)) {
if (version_compare(PHP_VERSION, '5.4.0', '>=')) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, self::p_backtrace_limit());
}
else {
$backtrace = debug_backtrace();
}
$argument_name = self::p_report_invalid_argument_string('argument_name', $backtrace);
unset($backtrace);
}
$error
->set_severity($severity);
self::p_load_backtrace($error);
self::p_invalid_bool($error, $argument_name);
return $error;
}