Code Duplication    Length = 13-13 lines in 4 locations

Classes/Database/DatabaseConnection.php 4 locations

@@ 1407-1419 (lines=13) @@
1404
     *
1405
     * @return array Array with tablenames as key and arrays with status information as value
1406
     */
1407
    public function admin_get_tables()
1408
    {
1409
        $this->logDeprecation();
1410
        $whichTables = [];
1411
        $tables_result = $this->query('SHOW TABLE STATUS FROM `' . $this->databaseName . '`');
1412
        if ($tables_result !== false) {
1413
            while ($theTable = $tables_result->fetch_assoc()) {
1414
                $whichTables[$theTable['Name']] = $theTable;
1415
            }
1416
            $tables_result->free();
1417
        }
1418
        return $whichTables;
1419
    }
1420
1421
    /**
1422
     * Returns information about each field in the $table (quering the DBMS)
@@ 1432-1444 (lines=13) @@
1429
     * @param string $tableName Table name
1430
     * @return array Field information in an associative array with fieldname => field row
1431
     */
1432
    public function admin_get_fields($tableName)
1433
    {
1434
        $this->logDeprecation();
1435
        $output = [];
1436
        $columns_res = $this->query('SHOW FULL COLUMNS FROM `' . $tableName . '`');
1437
        if ($columns_res !== false) {
1438
            while ($fieldRow = $columns_res->fetch_assoc()) {
1439
                $output[$fieldRow['Field']] = $fieldRow;
1440
            }
1441
            $columns_res->free();
1442
        }
1443
        return $output;
1444
    }
1445
1446
    /**
1447
     * Returns information about each index key in the $table (quering the DBMS)
@@ 1453-1465 (lines=13) @@
1450
     * @param string $tableName Table name
1451
     * @return array Key information in a numeric array
1452
     */
1453
    public function admin_get_keys($tableName)
1454
    {
1455
        $this->logDeprecation();
1456
        $output = [];
1457
        $keyRes = $this->query('SHOW KEYS FROM `' . $tableName . '`');
1458
        if ($keyRes !== false) {
1459
            while ($keyRow = $keyRes->fetch_assoc()) {
1460
                $output[] = $keyRow;
1461
            }
1462
            $keyRes->free();
1463
        }
1464
        return $output;
1465
    }
1466
1467
    /**
1468
     * Returns information about the character sets supported by the current DBM
@@ 1479-1491 (lines=13) @@
1476
     *
1477
     * @return array Array with Charset as key and an array of "Charset", "Description", "Default collation", "Maxlen" as values
1478
     */
1479
    public function admin_get_charsets()
1480
    {
1481
        $this->logDeprecation();
1482
        $output = [];
1483
        $columns_res = $this->query('SHOW CHARACTER SET');
1484
        if ($columns_res !== false) {
1485
            while ($row = $columns_res->fetch_assoc()) {
1486
                $output[$row['Charset']] = $row;
1487
            }
1488
            $columns_res->free();
1489
        }
1490
        return $output;
1491
    }
1492
1493
    /**
1494
     * mysqli() wrapper function, used by the Install Tool and EM for all queries regarding management of the database!