mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Early return for requiredness
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
90a2a808d6
commit
ab1e097b7c
|
@ -916,20 +916,20 @@ class Helper
|
|||
if ($rule_name == $field) {
|
||||
if (is_array($rule)) {
|
||||
if (in_array('required', $rule)) {
|
||||
$required = true;
|
||||
return true;
|
||||
} else {
|
||||
$required = false;
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (strpos($rule, 'required') === false) {
|
||||
$required = false;
|
||||
return false;
|
||||
} else {
|
||||
$required = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $required;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue