From a80a5f48a16e7d232168a7aaa68e9a1804235ce1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 18 Dec 2023 17:59:16 +0100 Subject: Pass PHPStan level 8 (#5946) * Pass PHPStan level 8 And prepare for PHPStan level 9 https://phpstan.org/user-guide/rule-levels * Revert wrong replace in comment * Fix PHPStan level 8 * Update PHPStan and other dev dependencies * Remove obsolete comment * noVariableVariables and towards bleedingEdge https://github.com/phpstan/phpstan-strict-rules https://phpstan.org/blog/what-is-bleeding-edge * More bleedingEdge * A bit more PHPStan level 9 * More PHPStan level 9 * Prepare for booleansInConditions Ignore int and null * Revert wrong line * More fixes * Fix keep_max_n_unread * Stricter attribute functions * Stricter callHooks and more PHPStan level 9 * More typing * A tiny more --- lib/lib_install.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/lib_install.php') diff --git a/lib/lib_install.php b/lib/lib_install.php index 720c4bf77..f36d2eaa6 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -77,13 +77,12 @@ function generateSalt(): string { } function initDb(): string { - $conf = FreshRSS_Context::$system_conf; - $db = $conf->db; + $db = FreshRSS_Context::systemConf()->db; if (empty($db['pdo_options'])) { $db['pdo_options'] = []; } $db['pdo_options'][PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION; - $conf->db = $db; //TODO: Remove this Minz limitation "Indirect modification of overloaded property" + FreshRSS_Context::systemConf()->db = $db; //TODO: Remove this Minz limitation "Indirect modification of overloaded property" if (empty($db['type'])) { $db['type'] = 'sqlite'; @@ -95,7 +94,7 @@ function initDb(): string { $dbBase = $db['base'] ?? ''; //For first connection, use default database for PostgreSQL, empty database for MySQL / MariaDB: $db['base'] = $db['type'] === 'pgsql' ? 'postgres' : ''; - $conf->db = $db; + FreshRSS_Context::systemConf()->db = $db; try { //First connection without database name to create the database $databaseDAO = FreshRSS_Factory::createDatabaseDAO(); @@ -104,7 +103,7 @@ function initDb(): string { } //Restore final database parameters for auto-creation and for future connections $db['base'] = $dbBase; - $conf->db = $db; + FreshRSS_Context::systemConf()->db = $db; if ($databaseDAO != null) { //Perform database auto-creation $databaseDAO->create(); -- cgit v1.2.3