Skip to content

Commit

Permalink
Small cs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierstoval committed Nov 25, 2024
1 parent d3e30d8 commit e128473
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions js/glpi_install.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@

success_element.querySelector('button').setAttribute('disabled', 'disabled');

const create_progress_bar = window.create_progress_bar;

if (typeof create_progress_bar === 'undefined') {
throw new Error('Function "create_progress_bar" is not defined. Did you load the associated JS file correctly?');
}

const progress = create_progress_bar({
key: progress_key,
container: messages_container,
Expand Down
3 changes: 1 addition & 2 deletions src/Glpi/Config/LegacyConfigurators/StandardIncludes.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ public function execute(): void

//Options from DB, do not touch this part.
if (
!$is_installing
&& !Config::loadLegacyConfiguration()
!Config::loadLegacyConfiguration()
&& !$skip_db_checks
) {
echo "Error accessing config table";
Expand Down
9 changes: 5 additions & 4 deletions src/Toolbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ public static function cleanNewLines($string)
*
* @param string $lang Language to install
* @param ?DBmysql $database Database instance to use, will fallback to a new instance of DB if null
* @param ?\Closure<?int, ?int, ?string> $progressCallback
* @param ?\Closure $progressCallback
*
* @return void
*
Expand All @@ -2079,8 +2079,7 @@ public static function createSchema($lang = 'en_GB', ?DBmysql $database = null,
global $DB;

if (!$progressCallback) {
$progressCallback = function ($a = null, $b = null, $c = null)
{
$progressCallback = function (?int $a = null, ?int $b = null, ?string $c = null) {
};
}

Expand Down Expand Up @@ -2108,7 +2107,9 @@ public static function createSchema($lang = 'en_GB', ?DBmysql $database = null,
$number_of_queries += \count($data);
}
$number_of_queries += 8; // For other calls
if (defined('GLPI_SYSTEM_CRON')) { $number_of_queries++; }
if (defined('GLPI_SYSTEM_CRON')) {
$number_of_queries++;
}

$progressCallback(null, $number_of_queries, __('Creating database structure…'));

Expand Down

0 comments on commit e128473

Please sign in to comment.