From 6147d28b37cbf4016c67602b09eedfbfdf2146d9 Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 2 Nov 2021 10:14:55 +0900 Subject: [PATCH] some backend admin class var declarations fixes --- phpstan.neon | 2 -- www/lib/CoreLibs/Admin/Backend.php | 20 ++++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index a4d7874b..18fb4871 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -43,8 +43,6 @@ parameters: - www/lib/smarty-*/ # ignore composer - www/vendor - # ignore tst folder - - www/tests # ignore errores with ignoreErrors: # this is ignored for now diff --git a/www/lib/CoreLibs/Admin/Backend.php b/www/lib/CoreLibs/Admin/Backend.php index 270873de..fb23ada5 100644 --- a/www/lib/CoreLibs/Admin/Backend.php +++ b/www/lib/CoreLibs/Admin/Backend.php @@ -44,7 +44,7 @@ class Backend extends \CoreLibs\DB\IO 'action', 'action_id', 'action_sub_id', 'action_yes', 'action_flag', 'action_menu', 'action_value', 'action_error', 'action_loaded' ]; - /** @var string */ + /** @var string|null */ public $action; /** @var string|int */ public $action_id; @@ -76,12 +76,12 @@ class Backend extends \CoreLibs\DB\IO // error/warning/info messages /** @var array */ public $messages = []; - /** @var int */ - public $error = 0; - /** @var int */ - public $warning = 0; - /** @var int */ - public $info = 0; + /** @var bool */ + public $error = false; + /** @var bool */ + public $warning = false; + /** @var bool */ + public $info = false; // internal lang & encoding vars /** @var string */ public $lang_dir = ''; @@ -479,13 +479,13 @@ class Backend extends \CoreLibs\DB\IO ]; switch ($level) { case 'info': - $this->info = 1; + $this->info = true; break; case 'warning': - $this->warning = 1; + $this->warning = true; break; case 'error': - $this->error = 1; + $this->error = true; break; } }