mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
Fix phpstan claims & php code sniffer errors
This commit is contained in:
parent
a167b6d21a
commit
73b1041816
@ -203,8 +203,8 @@ class MigrationsController extends CompatController
|
|||||||
} else {
|
} else {
|
||||||
Notification::error(
|
Notification::error(
|
||||||
$this->translate(
|
$this->translate(
|
||||||
'Applied migrations successfully. Though, one or more migration hooks failed to run.'
|
'Applied migrations successfully. Though, one or more migration hooks'
|
||||||
. ' See logs for details'
|
. ' failed to run. See logs for details'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,8 @@ abstract class MigrationHook implements Countable
|
|||||||
{
|
{
|
||||||
$pdoStmt = $conn->prepexec(
|
$pdoStmt = $conn->prepexec(
|
||||||
sprintf(
|
sprintf(
|
||||||
"SELECT %s AS column_type, %s AS column_length FROM information_schema.columns WHERE table_name = ? AND column_name = ?",
|
'SELECT %s AS column_type, %s AS column_length FROM information_schema.columns'
|
||||||
|
. ' WHERE table_name = ? AND column_name = ?',
|
||||||
$conn->getAdapter() instanceof Pgsql ? 'udt_name' : 'column_type',
|
$conn->getAdapter() instanceof Pgsql ? 'udt_name' : 'column_type',
|
||||||
$conn->getAdapter() instanceof Pgsql ? 'character_maximum_length' : 'NULL'
|
$conn->getAdapter() instanceof Pgsql ? 'character_maximum_length' : 'NULL'
|
||||||
),
|
),
|
||||||
@ -140,7 +141,7 @@ abstract class MigrationHook implements Countable
|
|||||||
$this->load();
|
$this->load();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->migrations;
|
return $this->migrations ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -289,8 +290,12 @@ abstract class MigrationHook implements Countable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort all the migrations by their version numbers in ascending order.
|
if ($this->migrations) {
|
||||||
uksort($this->migrations, 'version_compare');
|
// Sort all the migrations by their version numbers in ascending order.
|
||||||
|
uksort($this->migrations, function ($a, $b) {
|
||||||
|
return version_compare($a, $b);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user