fix: use numeric values within range for debug level setting

pull/183/head
Jeroen Pinoy 2024-11-16 14:57:16 +01:00
parent 9b92f86627
commit 54e4fca637
No known key found for this signature in database
GPG Key ID: DF33A50B8E4EE081
2 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ return [
* Development Mode: * Development Mode:
* true: Errors and warnings shown. * true: Errors and warnings shown.
*/ */
'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN), 'debug' => filter_var(env('DEBUG', 0), FILTER_VALIDATE_INT, array("options" => array("min_range"=>0, "max_range"=>1))),
/* /*
* Security and encryption configuration * Security and encryption configuration

View File

@ -346,11 +346,11 @@ class CerebrateSettingsProvider extends BaseSettingsProvider
'description' => __('The debug level of the instance'), 'description' => __('The debug level of the instance'),
'default' => 0, 'default' => 0,
'options' => [ 'options' => [
false => __('Debug Off'), 0 => __('Debug Off'),
true => __('Debug On'), 1 => __('Debug On'),
], ],
'test' => function ($value, $setting, $validator) { 'test' => function ($value, $setting, $validator) {
$validator->range('value', [0, 2]); $validator->range('value', [0, 1]);
return testValidator($value, $validator); return testValidator($value, $validator);
}, },
], ],