Fix PHPStan errors

This commit is contained in:
slawkens 2024-11-08 11:44:26 +01:00
parent b6e0184386
commit 88a0bc82d7
5 changed files with 13 additions and 5 deletions

View File

@ -2,7 +2,10 @@
use MyAAC\Settings;
$up = function () use ($db) {
function updateHighscoresIdsHidden(): void
{
global $db;
if (!$db->hasTable('players')) {
return;
}
@ -19,6 +22,10 @@ $up = function () use ($db) {
$settings = Settings::getInstance();
$settings->updateInDatabase('core', 'highscores_ids_hidden', implode(', ', $highscores_ignored_ids));
}
$up = function () {
updateHighscoresIdsHidden();
};
$down = function () {

View File

@ -9,7 +9,7 @@ $up = function () use ($db) {
}
};
$down = function () use ($db) {
$down = function () {
// we don't want data loss
//$db->dropColumn(TABLE_PREFIX . 'account_actions', 'ipv6');
};

View File

@ -11,6 +11,6 @@ $up = function () use ($db) {
$db->modifyColumn(TABLE_PREFIX . 'visitors', 'ip', 'VARCHAR(15) NOT NULL');
};
$down = function () use ($db) {
$down = function () {
// nothing to be done, as we have just extended the size of a column
};

View File

@ -10,7 +10,7 @@ $up = function () use ($db) {
}
};
$down = function () use ($db) {
$down = function () {
// will break the aac
//if ($db->hasTable(TABLE_PREFIX . 'settings')) {
// $db->dropTable(TABLE_PREFIX . 'settings');

View File

@ -5,8 +5,9 @@
// 2023-11-11
// execute highscores_ids_hidden once again, cause of settings
$up = function () use ($db) {
$up = function () {
require __DIR__ . '/20.php';
updateHighscoresIdsHidden();
};
$down = function () {