Skip to content

Commit 7c53199

Browse files
Fix merge issues (#18289)
* Fix type issues after merge Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> * Update DbiDummy.php Signed-off-by: Kamil Tekiela <tekiela246@gmail.com> --------- Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent c8862cc commit 7c53199

4 files changed

Lines changed: 6 additions & 25 deletions

File tree

libraries/classes/DatabaseInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public function getTablesFull(
412412
$sql .= ' LIMIT ' . $limitCount . ' OFFSET ' . $limitOffset;
413413
}
414414

415-
/** @var array<string, array<string, array<string, mixed>>> $tables */
415+
/** @var mixed[][][] $tables */
416416
$tables = $this->fetchResult(
417417
$sql,
418418
[
@@ -438,7 +438,7 @@ public function getTablesFull(
438438
[
439439
$tables[$oneDatabaseName][$oneTableName]['Data_length'],
440440
$tables[$oneDatabaseName][$oneTableName]['Index_length'],
441-
] = StorageEngine::getMroongaLengths($oneDatabaseName, $oneTableName);
441+
] = StorageEngine::getMroongaLengths((string) $oneDatabaseName, (string) $oneTableName);
442442
}
443443
}
444444

@@ -543,7 +543,7 @@ static function ($a, $b) {
543543
[
544544
$eachTables[$tableName]['Data_length'],
545545
$eachTables[$tableName]['Index_length'],
546-
] = StorageEngine::getMroongaLengths($database, $tableName);
546+
] = StorageEngine::getMroongaLengths($database, (string) $tableName);
547547
}
548548

549549
// Sort naturally if the config allows it and we're sorting

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3445,11 +3445,6 @@ parameters:
34453445
count: 2
34463446
path: libraries/classes/DatabaseInterface.php
34473447

3448-
-
3449-
message: "#^Parameter \\#2 \\$tableName of static method PhpMyAdmin\\\\StorageEngine\\:\\:getMroongaLengths\\(\\) expects string, \\(int\\|string\\) given\\.$#"
3450-
count: 1
3451-
path: libraries/classes/DatabaseInterface.php
3452-
34533448
-
34543449
message: "#^Method PhpMyAdmin\\\\Dbal\\\\DbalInterface\\:\\:connect\\(\\) has parameter \\$server with no value type specified in iterable type array\\.$#"
34553450
count: 1

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6136,8 +6136,8 @@
61366136
<code>$user</code>
61376137
</MixedArgument>
61386138
<MixedArgumentTypeCoercion>
6139-
<code>$tableName</code>
61406139
<code><![CDATA[uksort($eachTables, 'strnatcasecmp')]]></code>
6140+
<code><![CDATA[uksort($oneDatabaseTables, 'strnatcasecmp')]]></code>
61416141
</MixedArgumentTypeCoercion>
61426142
<MixedArrayAccess>
61436143
<code>$resultTarget[$row[$keyIndex]]</code>

test/classes/Stubs/DbiDummy.php

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,21 +1634,6 @@ private function init(): void
16341634
],
16351635
[
16361636
'query' => "SHOW TABLE STATUS FROM `my_dataset` WHERE `Name` LIKE 'company\\\\_users%'",
1637-
'result' => [],
1638-
],
1639-
[
1640-
'query' => 'SELECT *, `TABLE_SCHEMA` AS `Db`, `TABLE_NAME` AS `Name`,'
1641-
. ' `TABLE_TYPE` AS `TABLE_TYPE`, `ENGINE` AS `Engine`,'
1642-
. ' `ENGINE` AS `Type`, `VERSION` AS `Version`, `ROW_FORMAT` AS `Row_format`,'
1643-
. ' `TABLE_ROWS` AS `Rows`, `AVG_ROW_LENGTH` AS `Avg_row_length`,'
1644-
. ' `DATA_LENGTH` AS `Data_length`, `MAX_DATA_LENGTH` AS `Max_data_length`,'
1645-
. ' `INDEX_LENGTH` AS `Index_length`, `DATA_FREE` AS `Data_free`,'
1646-
. ' `AUTO_INCREMENT` AS `Auto_increment`, `CREATE_TIME` AS `Create_time`,'
1647-
. ' `UPDATE_TIME` AS `Update_time`, `CHECK_TIME` AS `Check_time`,'
1648-
. ' `TABLE_COLLATION` AS `Collation`, `CHECKSUM` AS `Checksum`,'
1649-
. ' `CREATE_OPTIONS` AS `Create_options`, `TABLE_COMMENT` AS `Comment`'
1650-
. " FROM `information_schema`.`TABLES` t WHERE `TABLE_SCHEMA` COLLATE utf8_bin IN ('table1')"
1651-
. " AND t.`TABLE_NAME` COLLATE utf8_bin = 'pma_test' ORDER BY Name ASC",
16521637
'columns' => [
16531638
'Name',
16541639
'TABLE_TYPE',
@@ -2833,7 +2818,8 @@ private function init(): void
28332818
. ' `CHECK_TIME` AS `Check_time`, `TABLE_COLLATION` AS `Collation`,'
28342819
. ' `CHECKSUM` AS `Checksum`, `CREATE_OPTIONS` AS `Create_options`,'
28352820
. ' `TABLE_COMMENT` AS `Comment` FROM `information_schema`.`TABLES` t'
2836-
. ' WHERE `TABLE_SCHEMA` IN (\'test_db\') AND t.`TABLE_NAME` IN (\'test_table\') ORDER BY Name ASC',
2821+
. ' WHERE `TABLE_SCHEMA` COLLATE utf8_bin IN (\'test_db\')'
2822+
. ' AND t.`TABLE_NAME` COLLATE utf8_bin IN (\'test_table\') ORDER BY Name ASC',
28372823
'columns' => [
28382824
'TABLE_CATALOG',
28392825
'TABLE_SCHEMA',

0 commit comments

Comments
 (0)