summaryrefslogtreecommitdiffstats
path: root/inc/database.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/database.inc.php')
-rw-r--r--inc/database.inc.php18
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;
}