1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 19:15:56 +00:00

Initial go at PHPStan rule level 6.

This commit is contained in:
wn_
2021-11-10 21:38:25 +00:00
parent 87a30d88d3
commit 4cc3374f9f
12 changed files with 93 additions and 48 deletions

View File

@@ -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()";
}
}