From 54e4fca637ad2e4f2e0548fd9b3a32d0ce0cd40a Mon Sep 17 00:00:00 2001 From: Jeroen Pinoy Date: Sat, 16 Nov 2024 14:57:16 +0100 Subject: [PATCH] fix: use numeric values within range for debug level setting --- config/app_local.example.php | 2 +- .../Table/SettingProviders/CerebrateSettingsProvider.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/app_local.example.php b/config/app_local.example.php index ed0c5ec..6b5e208 100644 --- a/config/app_local.example.php +++ b/config/app_local.example.php @@ -25,7 +25,7 @@ return [ * Development Mode: * 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 diff --git a/src/Model/Table/SettingProviders/CerebrateSettingsProvider.php b/src/Model/Table/SettingProviders/CerebrateSettingsProvider.php index 256b3a9..04e5590 100644 --- a/src/Model/Table/SettingProviders/CerebrateSettingsProvider.php +++ b/src/Model/Table/SettingProviders/CerebrateSettingsProvider.php @@ -346,11 +346,11 @@ class CerebrateSettingsProvider extends BaseSettingsProvider 'description' => __('The debug level of the instance'), 'default' => 0, 'options' => [ - false => __('Debug Off'), - true => __('Debug On'), + 0 => __('Debug Off'), + 1 => __('Debug On'), ], 'test' => function ($value, $setting, $validator) { - $validator->range('value', [0, 2]); + $validator->range('value', [0, 1]); return testValidator($value, $validator); }, ],