From 288ed04ccc30b58373576dc3be811aee43e67034 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 31 Mar 2023 08:23:39 +0200 Subject: PHPStan level 6 for all PDO and Exception classes (#5239) * PHPStan level 6 for all PDO and Exception classes Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112 * Fix type * Now also our remaining own librairies * Motivation for a few more files * A few more DAO classes * Last interface --- lib/lib_install.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/lib_install.php') diff --git a/lib/lib_install.php b/lib/lib_install.php index 931de21a2..18f4a732a 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -3,7 +3,8 @@ Minz_Configuration::register('default_system', join_path(FRESHRSS_PATH, 'config.default.php')); Minz_Configuration::register('default_user', join_path(FRESHRSS_PATH, 'config-user.default.php')); -function checkRequirements($dbType = '') { +/** @return array */ +function checkRequirements(string $dbType = ''): array { $php = version_compare(PHP_VERSION, FRESHRSS_MIN_PHP_VERSION) >= 0; $curl = extension_loaded('curl'); $pdo_mysql = extension_loaded('pdo_mysql'); @@ -74,11 +75,11 @@ function checkRequirements($dbType = '') { ); } -function generateSalt() { +function generateSalt(): string { return sha1(uniqid('' . mt_rand(), true).implode('', stat(__FILE__))); } -function initDb() { +function initDb(): string { $conf = FreshRSS_Context::$system_conf; $db = $conf->db; if (empty($db['pdo_options'])) { @@ -115,7 +116,7 @@ function initDb() { return $databaseDAO->testConnection(); } -function setupMigrations() { +function setupMigrations(): bool { $migrations_path = APP_PATH . '/migrations'; $migrations_version_path = DATA_PATH . '/applied_migrations.txt'; -- cgit v1.2.3