diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php
index 163f80d659..a7f6e19f39 100644
--- a/libraries/classes/Table.php
+++ b/libraries/classes/Table.php
@@ -205,24 +205,15 @@ class Table implements Stringable
/**
* Checks the storage engine used to create table
*
- * @param array|string $engine Checks the table engine against an
+ * @param string[]|string $engine Checks the table engine against an
* array of engine strings or a single string, should be uppercase
*/
public function isEngine($engine): bool
{
+ $engine = (array) $engine;
$tableStorageEngine = $this->getStorageEngine();
- if (is_array($engine)) {
- foreach ($engine as $e) {
- if ($e == $tableStorageEngine) {
- return true;
- }
- }
-
- return false;
- }
-
- return $tableStorageEngine == $engine;
+ return in_array($tableStorageEngine, $engine, true);
}
/**
@@ -362,9 +353,6 @@ class Table implements Stringable
public function getStorageEngine(): string
{
$tableStorageEngine = $this->getStatusInfo('ENGINE', false, true);
- if ($tableStorageEngine === false) {
- return '';
- }
return strtoupper((string) $tableStorageEngine);
}
@@ -2152,7 +2140,7 @@ class Table implements Stringable
$index->getChoice() !== 'SPATIAL'
&& $index->getChoice() !== 'FULLTEXT'
&& in_array($type, Index::getIndexTypes())
- && ! $this->isEngine(['TOKUDB'])
+ && ! $this->isEngine('TOKUDB')
) {
$sqlQuery .= ' USING ' . $type;
}
diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon
index fd07b47ff3..810b20150f 100644
--- a/phpstan-baseline.neon
+++ b/phpstan-baseline.neon
@@ -8080,11 +8080,6 @@ parameters:
count: 1
path: libraries/classes/Table.php
- -
- message: "#^Method PhpMyAdmin\\\\Table\\:\\:isEngine\\(\\) has parameter \\$engine with no value type specified in iterable type array\\.$#"
- count: 1
- path: libraries/classes/Table.php
-
-
message: "#^Method PhpMyAdmin\\\\Table\\:\\:updateForeignKeys\\(\\) has parameter \\$destinationForeignColumn with no value type specified in iterable type array\\.$#"
count: 1
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index fd2bafc3e5..d888ab2316 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -13640,7 +13640,7 @@
$optionsArray[$existrelForeign[$masterFieldMd5]['on_delete'] ?? '']
$optionsArray[$existrelForeign[$masterFieldMd5]['on_update'] ?? '']
-
+
$GLOBALS['errorUrl']
$cachedResult
$cachedResult
@@ -13651,7 +13651,6 @@
$constraintName
$createTable
$currCreateTime
- $e
$eachCol
$foreignDb
$foreignDb