diff options
author | wn_ <[email protected]> | 2021-11-12 21:17:31 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2021-11-12 21:17:31 +0000 |
commit | d3a81f598b24d6ae4f98415fac9509df6749eaf8 (patch) | |
tree | 79fcdaba8badc193595485c965e6150bcaaecd25 /classes/debug.php | |
parent | 2c41bc7fbc9013e79e929a31e3824cf040afc54a (diff) |
Switch class properties from PHP typing to PHPDoc for compatibility with PHP < 7.4.0
Diffstat (limited to 'classes/debug.php')
-rw-r--r-- | classes/debug.php | 48 |
1 files changed, 33 insertions, 15 deletions
diff --git a/classes/debug.php b/classes/debug.php index 6e8c46ed2..e20126b86 100644 --- a/classes/debug.php +++ b/classes/debug.php @@ -1,9 +1,9 @@ <?php class Debug { const LOG_DISABLED = -1; - const LOG_NORMAL = 0; - const LOG_VERBOSE = 1; - const LOG_EXTENDED = 2; + const LOG_NORMAL = 0; + const LOG_VERBOSE = 1; + const LOG_EXTENDED = 2; const ALL_LOG_LEVELS = [ Debug::LOG_DISABLED, @@ -12,26 +12,44 @@ class Debug { Debug::LOG_EXTENDED, ]; - /** @deprecated */ - public static int $LOG_DISABLED = self::LOG_DISABLED; + // TODO: class properties can be switched to PHP typing if/when the minimum PHP_VERSION is raised to 7.4.0+ + /** + * @deprecated + * @var int + */ + public static $LOG_DISABLED = self::LOG_DISABLED; + + /** + * @deprecated + * @var int + */ + public static $LOG_NORMAL = self::LOG_NORMAL; - /** @deprecated */ - public static int $LOG_NORMAL = self::LOG_NORMAL; + /** + * @deprecated + * @var int + */ + public static $LOG_VERBOSE = self::LOG_VERBOSE; + + /** + * @deprecated + * @var int + */ + public static $LOG_EXTENDED = self::LOG_EXTENDED; - /** @deprecated */ - public static int $LOG_VERBOSE = self::LOG_VERBOSE; + /** @var bool */ + private static $enabled = false; - /** @deprecated */ - public static int $LOG_EXTENDED = self::LOG_EXTENDED; + /** @var bool */ + private static $quiet = false; - private static bool $enabled = false; - private static bool $quiet = false; - private static ?string $logfile = null; + /** @var string|null */ + private static $logfile = null; /** * @var int Debug::LOG_* */ - private static int $loglevel = self::LOG_NORMAL; + private static $loglevel = self::LOG_NORMAL; public static function set_logfile(string $logfile): void { self::$logfile = $logfile; |