Use array_fill_keys
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
49cb7e89b2
commit
cd9ca8419a
@ -19,6 +19,7 @@ use PhpMyAdmin\Util;
|
||||
use PhpMyAdmin\Version;
|
||||
|
||||
use function __;
|
||||
use function array_fill_keys;
|
||||
use function array_keys;
|
||||
use function array_reverse;
|
||||
use function array_search;
|
||||
@ -220,9 +221,6 @@ class Relation
|
||||
*/
|
||||
private function checkRelationsParam(): array
|
||||
{
|
||||
$relationParams = [];
|
||||
$relationParams['version'] = Version::VERSION;
|
||||
|
||||
$workToTable = [
|
||||
'relwork' => 'relation',
|
||||
'displaywork' => ['relation', 'table_info'],
|
||||
@ -244,10 +242,9 @@ class Relation
|
||||
'exporttemplateswork' => 'export_templates',
|
||||
];
|
||||
|
||||
foreach (array_keys($workToTable) as $work) {
|
||||
$relationParams[$work] = false;
|
||||
}
|
||||
$relationParams = array_fill_keys(array_keys($workToTable), false);
|
||||
|
||||
$relationParams['version'] = Version::VERSION;
|
||||
$relationParams['allworks'] = false;
|
||||
$relationParams['user'] = null;
|
||||
$relationParams['db'] = null;
|
||||
|
||||
@ -710,11 +710,6 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: "#^Foreach overwrites \\$work with its key variable\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/ConfigStorage/Relation.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\ConfigStorage\\\\Relation\\:\\:getDisplayField\\(\\) should return string\\|false but returns mixed\\.$#"
|
||||
count: 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user