Add some more truth states to test

This commit is contained in:
Nabeel Shahzad
2018-01-21 13:52:55 -05:00
parent 0b9654cf61
commit 33cbceaa92

View File

@@ -10,12 +10,18 @@ if(!function_exists('get_truth_state')) {
function get_truth_state($state) function get_truth_state($state)
{ {
$enabledStates = [ $enabledStates = [
'yes',
'y',
'on', 'on',
'true', 'true',
'1', '1',
true, true,
]; ];
if(is_string($state)) {
$state = strtolower($state);
}
return \in_array($state, $enabledStates, false); return \in_array($state, $enabledStates, false);
} }
} }