summaryrefslogtreecommitdiff
path: root/lib/lib_install.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2023-03-31 08:23:39 +0200
committerGravatar GitHub <noreply@github.com> 2023-03-31 08:23:39 +0200
commit288ed04ccc30b58373576dc3be811aee43e67034 (patch)
tree27f4c571e04d64c97737416dfa2b8d65f481dfd8 /lib/lib_install.php
parentc9d5fe2da12cbc3a071ebf9a518afe2789bb3d61 (diff)
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
Diffstat (limited to 'lib/lib_install.php')
-rw-r--r--lib/lib_install.php9
1 files changed, 5 insertions, 4 deletions
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<string,string> */
+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';