diff options
author | Simon Rettberg | 2023-10-06 18:26:22 +0200 |
---|---|---|
committer | Simon Rettberg | 2023-10-06 18:26:22 +0200 |
commit | e5be4e97ffc41ca3b0386651a626b781a3637a85 (patch) | |
tree | 20152d35607de272edae44725efba13f21da85a1 /inc/database.inc.php | |
parent | api: Hard-code bogus name/mail for read only (STUDENT) login (diff) | |
download | bwlp-webadmin-e5be4e97ffc41ca3b0386651a626b781a3637a85.tar.gz bwlp-webadmin-e5be4e97ffc41ca3b0386651a626b781a3637a85.tar.xz bwlp-webadmin-e5be4e97ffc41ca3b0386651a626b781a3637a85.zip |
Update for PHP 8.2
Diffstat (limited to 'inc/database.inc.php')
-rw-r--r-- | inc/database.inc.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/inc/database.inc.php b/inc/database.inc.php index c1f9454..6518631 100644 --- a/inc/database.inc.php +++ b/inc/database.inc.php @@ -10,20 +10,20 @@ class Database /** * @var \PDO Database handle */ - private static $dbh = false; + private static ?PDO $dbh = null; - private static $returnErrors; - private static $lastError = false; - private static $explainList = array(); - private static $queryCount = 0; - private static $queryTime = 0; + private static bool $returnErrors; + private static ?string $lastError = null; + private static array $explainList = array(); + private static int $queryCount = 0; + private static float $queryTime = 0; /** * Connect to the DB if not already connected. */ public static function init(bool $returnErrors = false): bool { - if (self::$dbh !== false) + if (self::$dbh !== null) return true; self::$returnErrors = $returnErrors; try { @@ -164,9 +164,9 @@ class Database } /** - * @return string|false return last error returned by query + * @return ?string return last error returned by query */ - public static function lastError() + public static function lastError(): ?string { return self::$lastError; } |