boolean parse method
This commit is contained in:
parent
2ea6233774
commit
01d5c79fee
@ -176,4 +176,18 @@ abstract class Formatter {
|
||||
}
|
||||
return 'OTH';
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the given Value into a Bool
|
||||
*
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public static function parseBoolean($value) {
|
||||
if (is_string($value)) {
|
||||
$value = strtolower($value);
|
||||
}
|
||||
$bool = filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||
return $bool;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user