summaryrefslogtreecommitdiff
path: root/classes/db.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-11-18 07:32:28 +0300
committerAndrew Dolgov <[email protected]>2021-11-18 07:32:28 +0300
commit63ec5a89657bb7f9650582b96e0bb255a0889b48 (patch)
tree074b61eedd7304ba1d8d7deec01d26973ef8e6b8 /classes/db.php
parent3a3fde1a2e0beac6d179c6449eaad726100710d7 (diff)
parent2d830c6281c19a7ee29cd379f5aedc82deef3775 (diff)
Merge branch 'wip-phpstan-level6'
Diffstat (limited to 'classes/db.php')
-rwxr-xr-xclasses/db.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/classes/db.php b/classes/db.php
index 7b669cf32..2cc89f5ba 100755
--- a/classes/db.php
+++ b/classes/db.php
@@ -17,7 +17,7 @@ class Db
}
}
- static function NOW() {
+ static function NOW(): string {
return date("Y-m-d H:i:s", time());
}
@@ -25,7 +25,7 @@ class Db
//
}
- public static function get_dsn() {
+ public static function get_dsn(): string {
$db_port = Config::get(Config::DB_PORT) ? ';port=' . Config::get(Config::DB_PORT) : '';
$db_host = Config::get(Config::DB_HOST) ? ';host=' . Config::get(Config::DB_HOST) : '';
if (Config::get(Config::DB_TYPE) == "mysql" && Config::get(Config::MYSQL_CHARSET)) {
@@ -88,12 +88,11 @@ class Db
return self::$instance->pdo;
}
- public static function sql_random_function() {
+ public static function sql_random_function(): string {
if (Config::get(Config::DB_TYPE) == "mysql") {
return "RAND()";
- } else {
- return "RANDOM()";
}
+ return "RANDOM()";
}
}