]> git.joonet.de Git - adminer.git/commitdiff
Code style: Indent long statements
authorJakub Vrana <jakub@vrana.cz>
Wed, 5 Mar 2025 13:59:13 +0000 (14:59 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 5 Mar 2025 13:59:13 +0000 (14:59 +0100)
15 files changed:
adminer/db.inc.php
adminer/drivers/mssql.inc.php
adminer/drivers/mysql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/include/connect.inc.php
adminer/include/editing.inc.php
adminer/select.inc.php
adminer/user.inc.php
editor/include/adminer.inc.php
phpcs.xml
plugins/drivers/clickhouse.php
plugins/drivers/elastic.php
plugins/drivers/elastic5.php
plugins/drivers/simpledb.php

index bb4464dbd0831e76fd59948c8495afd31639221c..06b5b60beda3c0669782cfdbe3f9d2044df859fe 100644 (file)
@@ -99,15 +99,17 @@ if ($adminer->homepage()) {
                                        echo '<td colspan="6"><a href="' . h(ME) . "view=" . urlencode($name) . '" title="' . lang('Alter view') . '">' . (preg_match('~materialized~i', $type) ? lang('Materialized view') : lang('View')) . '</a>';
                                        echo '<td align="right"><a href="' . h(ME) . "select=" . urlencode($name) . '" title="' . lang('Select data') . '">?</a>';
                                } else {
-                                       foreach (array(
-                                               "Engine" => array(),
-                                               "Collation" => array(),
-                                               "Data_length" => array("create", lang('Alter table')),
-                                               "Index_length" => array("indexes", lang('Alter indexes')),
-                                               "Data_free" => array("edit", lang('New item')),
-                                               "Auto_increment" => array("auto_increment=1&create", lang('Alter table')),
-                                               "Rows" => array("select", lang('Select data')),
-                                       ) as $key => $link) {
+                                       foreach (
+                                               array(
+                                                       "Engine" => array(),
+                                                       "Collation" => array(),
+                                                       "Data_length" => array("create", lang('Alter table')),
+                                                       "Index_length" => array("indexes", lang('Alter indexes')),
+                                                       "Data_free" => array("edit", lang('New item')),
+                                                       "Auto_increment" => array("auto_increment=1&create", lang('Alter table')),
+                                                       "Rows" => array("select", lang('Select data')),
+                                               ) as $key => $link
+                                       ) {
                                                $id = " id='$key-" . h($name) . "'";
                                                echo ($link ? "<td align='right'>" . (support("table") || $key == "Rows" || (support("indexes") && $key != "Data_length")
                                                        ? "<a href='" . h(ME . "$link[0]=") . urlencode($name) . "'$id title='$link[1]'>?</a>"
index 753b8806211c952da66e94f4cc50b6ef3f3b11bf..c40a3c637fc26f8fc541fe4c5f415859d7f9dc5c 100644 (file)
@@ -310,9 +310,11 @@ if (isset($_GET["mssql"])) {
 
        function table_status($name = "") {
                $return = array();
-               foreach (get_rows("SELECT ao.name AS Name, ao.type_desc AS Engine, (SELECT value FROM fn_listextendedproperty(default, 'SCHEMA', schema_name(schema_id), 'TABLE', ao.name, null, null)) AS Comment
+               foreach (
+                       get_rows("SELECT ao.name AS Name, ao.type_desc AS Engine, (SELECT value FROM fn_listextendedproperty(default, 'SCHEMA', schema_name(schema_id), 'TABLE', ao.name, null, null)) AS Comment
 FROM sys.all_objects AS ao
-WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row) {
+WHERE schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND type IN ('S', 'U', 'V') " . ($name != "" ? "AND name = " . q($name) : "ORDER BY name")) as $row
+               ) {
                        if ($name != "") {
                                return $row;
                        }
@@ -366,11 +368,13 @@ WHERE o.schema_id = SCHEMA_ID(" . q(get_schema()) . ") AND o.type IN ('S', 'U',
        function indexes($table, $connection2 = null) {
                $return = array();
                // sp_statistics doesn't return information about primary key
-               foreach (get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name, is_descending_key
+               foreach (
+                       get_rows("SELECT i.name, key_ordinal, is_unique, is_primary_key, c.name AS column_name, is_descending_key
 FROM sys.indexes i
 INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id
 INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id
-WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row) {
+WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row
+               ) {
                        $name = $row["name"];
                        $return[$name]["type"] = ($row["is_primary_key"] ? "PRIMARY" : ($row["is_unique"] ? "UNIQUE" : "INDEX"));
                        $return[$name]["lengths"] = array();
@@ -492,7 +496,8 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table), $connection2) as $row) {
                        } elseif (!queries(($val[0] != "PRIMARY"
                                ? "CREATE $val[0] " . ($val[0] != "INDEX" ? "INDEX " : "") . idf_escape($val[1] != "" ? $val[1] : uniqid($table . "_")) . " ON " . table($table)
                                : "ALTER TABLE " . table($table) . " ADD PRIMARY KEY"
-                       ) . " (" . implode(", ", $val[2]) . ")")) {
+                       ) . " (" . implode(", ", $val[2]) . ")")
+                       ) {
                                return false;
                        }
                }
@@ -679,12 +684,14 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)) as $row
                $on_actions = str_replace('RESTRICT|', '', $on_actions);
                $types = array();
                $structured_types = array();
-               foreach (array( //! use sys.types
-                       lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "int" => 10, "bigint" => 20, "bit" => 1, "decimal" => 0, "real" => 12, "float" => 53, "smallmoney" => 10, "money" => 20),
-                       lang('Date and time') => array("date" => 10, "smalldatetime" => 19, "datetime" => 19, "datetime2" => 19, "time" => 8, "datetimeoffset" => 10),
-                       lang('Strings') => array("char" => 8000, "varchar" => 8000, "text" => 2147483647, "nchar" => 4000, "nvarchar" => 4000, "ntext" => 1073741823),
-                       lang('Binary') => array("binary" => 8000, "varbinary" => 8000, "image" => 2147483647),
-               ) as $key => $val) {
+               foreach (
+                       array( //! use sys.types
+                               lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "int" => 10, "bigint" => 20, "bit" => 1, "decimal" => 0, "real" => 12, "float" => 53, "smallmoney" => 10, "money" => 20),
+                               lang('Date and time') => array("date" => 10, "smalldatetime" => 19, "datetime" => 19, "datetime2" => 19, "time" => 8, "datetimeoffset" => 10),
+                               lang('Strings') => array("char" => 8000, "varchar" => 8000, "text" => 2147483647, "nchar" => 4000, "nvarchar" => 4000, "ntext" => 1073741823),
+                               lang('Binary') => array("binary" => 8000, "varbinary" => 8000, "image" => 2147483647),
+                       ) as $key => $val
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index d255e9095d97b93a597223c48f0c4c564c2f57d7..d78bef82cf17a27b717fe36957c95cb5b1777aa1 100644 (file)
@@ -876,7 +876,8 @@ if (!defined("DRIVER")) {
                        $name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));
                        $view = view($table);
                        if (($_POST["overwrite"] && !queries("DROP VIEW IF EXISTS $name"))
-                               || !queries("CREATE VIEW $name AS $view[select]")) { //! USE to avoid db.table
+                               || !queries("CREATE VIEW $name AS $view[select]") //! USE to avoid db.table
+                       ) {
                                return false;
                        }
                }
@@ -1175,14 +1176,16 @@ if (!defined("DRIVER")) {
        function driver_config() {
                $types = array(); ///< @var array [$type => $maximum_unsigned_length, ...]
                $structured_types = array(); ///< @var array [$description => [$type, ...], ...]
-               foreach (array(
-                       lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "decimal" => 66, "float" => 12, "double" => 21),
-                       lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
-                       lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
-                       lang('Lists') => array("enum" => 65535, "set" => 64),
-                       lang('Binary') => array("bit" => 20, "binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
-                       lang('Geometry') => array("geometry" => 0, "point" => 0, "linestring" => 0, "polygon" => 0, "multipoint" => 0, "multilinestring" => 0, "multipolygon" => 0, "geometrycollection" => 0),
-               ) as $key => $val) {
+               foreach (
+                       array(
+                               lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "decimal" => 66, "float" => 12, "double" => 21),
+                               lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
+                               lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
+                               lang('Lists') => array("enum" => 65535, "set" => 64),
+                               lang('Binary') => array("bit" => 20, "binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
+                               lang('Geometry') => array("geometry" => 0, "point" => 0, "linestring" => 0, "polygon" => 0, "multipoint" => 0, "multilinestring" => 0, "multipolygon" => 0, "geometrycollection" => 0),
+                       ) as $key => $val
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index 3cebc9947c7110aad0ab17f9ce5d3ad2102a8269..f9f5b6f0f67e6d684c7616f1db881febb52429ce 100644 (file)
@@ -160,8 +160,8 @@ if (isset($_GET["oracle"])) {
                                        }
                                }
                                if (!(($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && $connection->affected_rows)
-                                       || queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")")
-                               )) {
+                                       || queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"))
+                               ) {
                                        return false;
                                }
                        }
@@ -322,12 +322,14 @@ ORDER BY 1") as $row
        function indexes($table, $connection2 = null) {
                $return = array();
                $owner = where_owner(" AND ", "aic.table_owner");
-               foreach (get_rows("SELECT aic.*, ac.constraint_type, atc.data_default
+               foreach (
+                       get_rows("SELECT aic.*, ac.constraint_type, atc.data_default
 FROM all_ind_columns aic
 LEFT JOIN all_constraints ac ON aic.index_name = ac.constraint_name AND aic.table_name = ac.table_name AND aic.index_owner = ac.owner
 LEFT JOIN all_tab_cols atc ON aic.column_name = atc.column_name AND aic.table_name = atc.table_name AND aic.index_owner = atc.owner
 WHERE aic.table_name = " . q($table) . "$owner
-ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row) {
+ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row
+               ) {
                        $index_name = $row["INDEX_NAME"];
                        $column_name = $row["DATA_DEFAULT"];
                        $column_name = ($column_name ? trim($column_name, '"') : $row["COLUMN_NAME"]); // trim - possibly wrapped in quotes but never contains quotes inside
@@ -521,12 +523,14 @@ ORDER BY PROCESS
        function driver_config() {
                $types = array();
                $structured_types = array();
-               foreach (array(
-                       lang('Numbers') => array("number" => 38, "binary_float" => 12, "binary_double" => 21),
-                       lang('Date and time') => array("date" => 10, "timestamp" => 29, "interval year" => 12, "interval day" => 28), //! year(), day() to second()
-                       lang('Strings') => array("char" => 2000, "varchar2" => 4000, "nchar" => 2000, "nvarchar2" => 4000, "clob" => 4294967295, "nclob" => 4294967295),
-                       lang('Binary') => array("raw" => 2000, "long raw" => 2147483648, "blob" => 4294967295, "bfile" => 4294967296),
-               ) as $key => $val) {
+               foreach (
+                       array(
+                               lang('Numbers') => array("number" => 38, "binary_float" => 12, "binary_double" => 21),
+                               lang('Date and time') => array("date" => 10, "timestamp" => 29, "interval year" => 12, "interval day" => 28), //! year(), day() to second()
+                               lang('Strings') => array("char" => 2000, "varchar2" => 4000, "nchar" => 2000, "nvarchar2" => 4000, "clob" => 4294967295, "nclob" => 4294967295),
+                               lang('Binary') => array("raw" => 2000, "long raw" => 2147483648, "blob" => 4294967295, "bfile" => 4294967296),
+                       ) as $key => $val
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index b060995e8bc4954b7e8688da04a48226360b9ec4..57b68d3eadac0900985d87e6b19ecd182757746a 100644 (file)
@@ -209,8 +209,8 @@ if (isset($_GET["pgsql"])) {
                                        }
                                }
                                if (!(($where && queries("UPDATE " . table($table) . " SET " . implode(", ", $update) . " WHERE " . implode(" AND ", $where)) && $connection->affected_rows)
-                                       || queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")")
-                               )) {
+                                       || queries("INSERT INTO " . table($table) . " (" . implode(", ", array_keys($set)) . ") VALUES (" . implode(", ", $set) . ")"))
+                               ) {
                                        return false;
                                }
                        }
@@ -450,11 +450,13 @@ ORDER BY a.attnum") as $row
        function foreign_keys($table) {
                global $on_actions;
                $return = array();
-               foreach (get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
+               foreach (
+                       get_rows("SELECT conname, condeferrable::int AS deferrable, pg_get_constraintdef(oid) AS definition
 FROM pg_constraint
 WHERE conrelid = (SELECT pc.oid FROM pg_class AS pc INNER JOIN pg_namespace AS pn ON (pn.oid = pc.relnamespace) WHERE pc.relname = " . q($table) . " AND pn.nspname = current_schema())
 AND contype = 'f'::char
-ORDER BY conkey, conname") as $row) {
+ORDER BY conkey, conname") as $row
+               ) {
                        if (preg_match('~FOREIGN KEY\s*\((.+)\)\s*REFERENCES (.+)\((.+)\)(.*)$~iA', $row['definition'], $match)) {
                                $row['source'] = array_map('Adminer\idf_unescape', array_map('trim', explode(',', $match[1])));
                                if (preg_match('~^(("([^"]|"")+"|[^"]+)\.)?"?("([^"]|"")+"|[^"]+)$~', $match[2], $match2)) {
@@ -721,11 +723,7 @@ ORDER BY SPECIFIC_NAME');
 
        function found_rows($table_status, $where) {
                global $connection;
-               if (preg_match(
-                       "~ rows=([0-9]+)~",
-                       $connection->result("EXPLAIN SELECT * FROM " . idf_escape($table_status["Name"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")),
-                       $regs
-               )) {
+               if (preg_match("~ rows=([0-9]+)~", $connection->result("EXPLAIN SELECT * FROM " . idf_escape($table_status["Name"]) . ($where ? " WHERE " . implode(" AND ", $where) : "")), $regs)) {
                        return $regs[1];
                }
                return false;
@@ -918,14 +916,16 @@ AND typelem = 0"
        function driver_config() {
                $types = array();
                $structured_types = array();
-               foreach (array( //! arrays
-                       lang('Numbers') => array("smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1, "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20),
-                       lang('Date and time') => array("date" => 13, "time" => 17, "timestamp" => 20, "timestamptz" => 21, "interval" => 0),
-                       lang('Strings') => array("character" => 0, "character varying" => 0, "text" => 0, "tsquery" => 0, "tsvector" => 0, "uuid" => 0, "xml" => 0),
-                       lang('Binary') => array("bit" => 0, "bit varying" => 0, "bytea" => 0),
-                       lang('Network') => array("cidr" => 43, "inet" => 43, "macaddr" => 17, "macaddr8" => 23, "txid_snapshot" => 0),
-                       lang('Geometry') => array("box" => 0, "circle" => 0, "line" => 0, "lseg" => 0, "path" => 0, "point" => 0, "polygon" => 0),
-               ) as $key => $val) { //! can be retrieved from pg_type
+               foreach (
+                       array( //! arrays
+                               lang('Numbers') => array("smallint" => 5, "integer" => 10, "bigint" => 19, "boolean" => 1, "numeric" => 0, "real" => 7, "double precision" => 16, "money" => 20),
+                               lang('Date and time') => array("date" => 13, "time" => 17, "timestamp" => 20, "timestamptz" => 21, "interval" => 0),
+                               lang('Strings') => array("character" => 0, "character varying" => 0, "text" => 0, "tsquery" => 0, "tsvector" => 0, "uuid" => 0, "xml" => 0),
+                               lang('Binary') => array("bit" => 0, "bit varying" => 0, "bytea" => 0),
+                               lang('Network') => array("cidr" => 43, "inet" => 43, "macaddr" => 17, "macaddr8" => 23, "txid_snapshot" => 0),
+                               lang('Geometry') => array("box" => 0, "circle" => 0, "line" => 0, "lseg" => 0, "path" => 0, "point" => 0, "polygon" => 0),
+                       ) as $key => $val //! can be retrieved from pg_type
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index 3a03a072583e0eb799c1d6dec62e3a924f7b10de..df1bf7bb57c8802313da5ec973283d6f09e4d6ba 100644 (file)
@@ -23,13 +23,15 @@ if (!(DB != "" ? $connection->select_db(DB) : isset($_GET["sql"]) || isset($_GET
 
                page_header(lang('Select database'), $error, false);
                echo "<p class='links'>\n";
-               foreach (array(
-                       'database' => lang('Create database'),
-                       'privileges' => lang('Privileges'),
-                       'processlist' => lang('Process list'),
-                       'variables' => lang('Variables'),
-                       'status' => lang('Status'),
-               ) as $key => $val) {
+               foreach (
+                       array(
+                               'database' => lang('Create database'),
+                               'privileges' => lang('Privileges'),
+                               'processlist' => lang('Process list'),
+                               'variables' => lang('Variables'),
+                               'status' => lang('Status'),
+                       ) as $key => $val
+               ) {
                        if (support($key)) {
                                echo "<a href='" . h(ME) . "$key='>$val</a>\n";
                        }
index da44e4353fde23657a7e2071b63c54aa7aa60c03..0106b9a8a32676e5ce6b63fb9894b88666f5ee57 100644 (file)
@@ -315,12 +315,14 @@ function default_value($field) {
 * @return string class=''
 */
 function type_class($type) {
-       foreach (array(
-               'char' => 'text',
-               'date' => 'time|year',
-               'binary' => 'blob',
-               'enum' => 'set',
-       ) as $key => $val) {
+       foreach (
+               array(
+                       'char' => 'text',
+                       'date' => 'time|year',
+                       'binary' => 'blob',
+                       'enum' => 'set',
+               ) as $key => $val
+       ) {
                if (preg_match("~$key|$val~", $type)) {
                        return " class='$key'";
                }
index 50a8530fc2e73fa97722400917d80aadcc355e87..4e2a6ab73a59f0b0b0ab574ec6a9aecc5305585f 100644 (file)
@@ -229,8 +229,8 @@ if (isset($rights["insert"]) || !support("table")) {
        $params = array();
        foreach ((array) $_GET["where"] as $val) {
                if (isset($foreign_keys[$val["col"]]) && count($foreign_keys[$val["col"]]) == 1
-                       && ($val["op"] == "=" || (!$val["op"] && (is_array($val["val"]) || !preg_match('~[_%]~', $val["val"]))) // LIKE in Editor
-               )) {
+                       && ($val["op"] == "=" || (!$val["op"] && (is_array($val["val"]) || !preg_match('~[_%]~', $val["val"])))) // LIKE in Editor
+               ) {
                        $params["set" . "[" . bracket_escape($val["col"]) . "]"] = $val["val"];
                }
        }
index cf4ecc77aea86a533ac330ad036194bd3c12cc54..7cfbb517c99264b7c9c6eb98a4ddab981f46336b 100644 (file)
@@ -88,8 +88,8 @@ if ($_POST && !$error) {
                                }
                                if (preg_match('~^(.+)\s*(\(.*\))?$~U', $object, $match) && (
                                        !grant("REVOKE", $revoke, $match[2], " ON $match[1] FROM $new_user") //! SQL injection
-                                       || !grant("GRANT", $grant, $match[2], " ON $match[1] TO $new_user")
-                               )) {
+                                       || !grant("GRANT", $grant, $match[2], " ON $match[1] TO $new_user"))
+                               ) {
                                        $error = true;
                                        break;
                                }
@@ -152,14 +152,16 @@ foreach ($grants as $object => $grant) {
 }
 echo "</thead>\n";
 
-foreach (array(
-       "" => "",
-       "Server Admin" => lang('Server'),
-       "Databases" => lang('Database'),
-       "Tables" => lang('Table'),
-       "Columns" => lang('Column'),
-       "Procedures" => lang('Routine'),
-) as $context => $desc) {
+foreach (
+       array(
+               "" => "",
+               "Server Admin" => lang('Server'),
+               "Databases" => lang('Database'),
+               "Tables" => lang('Table'),
+               "Columns" => lang('Column'),
+               "Procedures" => lang('Routine'),
+       ) as $context => $desc
+) {
        foreach ((array) $privileges[$context] as $privilege => $comment) {
                echo "<tr><td" . ($desc ? ">$desc<td" : " colspan='2'") . ' lang="en" title="' . h($comment) . '">' . h($privilege);
                $i = 0;
index 10cb532c7fb412cf605eff0a62518c4d27ef9fdf..752aa747f25a7e1d4d4ed67bdec6c34587270082 100644 (file)
@@ -110,12 +110,14 @@ class Adminer {
 
        function backwardKeys($table, $tableName) {
                $return = array();
-               foreach (get_rows("SELECT TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME, REFERENCED_COLUMN_NAME
+               foreach (
+                       get_rows("SELECT TABLE_NAME, CONSTRAINT_NAME, COLUMN_NAME, REFERENCED_COLUMN_NAME
 FROM information_schema.KEY_COLUMN_USAGE
 WHERE TABLE_SCHEMA = " . q($this->database()) . "
 AND REFERENCED_TABLE_SCHEMA = " . q($this->database()) . "
 AND REFERENCED_TABLE_NAME = " . q($table) . "
-ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
+ORDER BY ORDINAL_POSITION", null, "") as $row //! requires MySQL 5
+               ) {
                        $return[$row["TABLE_NAME"]]["keys"][$row["CONSTRAINT_NAME"]][$row["COLUMN_NAME"]] = $row["REFERENCED_COLUMN_NAME"];
                }
                foreach ($return as $key => $val) {
index 8b2bd148fcfde48dd35efb467811e5c3bd08ad24..ede8b49875f73965602717b622f174deb2b12535 100644 (file)
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -25,7 +25,6 @@
                <exclude name="PSR12.Classes.OpeningBraceSpace.Found"/>
                <exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps"/>
                <exclude name="PSR2.Methods.MethodDeclaration.Underscore"/>
-               <exclude name="PSR12.ControlStructures.ControlStructureSpacing.CloseParenthesisLine"/>
                <exclude name="PSR12.ControlStructures.ControlStructureSpacing.FirstExpressionLine"/>
                <exclude name="PSR12.ControlStructures.ControlStructureSpacing.LineIndent"/>
                <exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine"/><!-- Replaced by: Generic.Functions.OpeningFunctionBraceKernighanRitchie -->
index a06fb0064c414c9998c194af1b77e19f73598f04..7ec86fdc28178a4aed0e030ba7e538d78c40795a 100644 (file)
@@ -371,12 +371,14 @@ if (isset($_GET["clickhouse"])) {
        function driver_config() {
                $types = array();
                $structured_types = array();
-               foreach (array( //! arrays
-                       lang('Numbers') => array("Int8" => 3, "Int16" => 5, "Int32" => 10, "Int64" => 19, "UInt8" => 3, "UInt16" => 5, "UInt32" => 10, "UInt64" => 20, "Float32" => 7, "Float64" => 16, 'Decimal' => 38, 'Decimal32' => 9, 'Decimal64' => 18, 'Decimal128' => 38),
-                       lang('Date and time') => array("Date" => 13, "DateTime" => 20),
-                       lang('Strings') => array("String" => 0),
-                       lang('Binary') => array("FixedString" => 0),
-               ) as $key => $val) {
+               foreach (
+                       array( //! arrays
+                               lang('Numbers') => array("Int8" => 3, "Int16" => 5, "Int32" => 10, "Int64" => 19, "UInt8" => 3, "UInt16" => 5, "UInt32" => 10, "UInt64" => 20, "Float32" => 7, "Float64" => 16, 'Decimal' => 38, 'Decimal32' => 9, 'Decimal64' => 18, 'Decimal128' => 38),
+                               lang('Date and time') => array("Date" => 13, "DateTime" => 20),
+                               lang('Strings') => array("String" => 0),
+                               lang('Binary') => array("FixedString" => 0),
+                       ) as $key => $val
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index 47575ce7be285fa1b0ff9c5344551514fab2bde4..1595e5eb7e721f665e5825e753e71886f834076f 100644 (file)
@@ -559,12 +559,14 @@ if (isset($_GET["elastic"])) {
                $types = array();
                $structured_types = array();
 
-               foreach (array(
-                       lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
-                       lang('Date and time') => array("date" => 10),
-                       lang('Strings') => array("string" => 65535, "text" => 65535),
-                       lang('Binary') => array("binary" => 255),
-               ) as $key => $val) {
+               foreach (
+                       array(
+                               lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
+                               lang('Date and time') => array("date" => 10),
+                               lang('Strings') => array("string" => 65535, "text" => 65535),
+                               lang('Binary') => array("binary" => 255),
+                       ) as $key => $val
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index 40522958f3ddb430e4df520a74a7f69cbaa45237..f3c69130d24b480f11a97746cbae44b892e388fa 100644 (file)
@@ -523,12 +523,14 @@ if (isset($_GET["elastic5"])) {
                $types = array();
                $structured_types = array();
 
-               foreach (array(
-                       lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
-                       lang('Date and time') => array("date" => 10),
-                       lang('Strings') => array("string" => 65535, "text" => 65535),
-                       lang('Binary') => array("binary" => 255),
-               ) as $key => $val) {
+               foreach (
+                       array(
+                               lang('Numbers') => array("long" => 3, "integer" => 5, "short" => 8, "byte" => 10, "double" => 20, "float" => 66, "half_float" => 12, "scaled_float" => 21),
+                               lang('Date and time') => array("date" => 10),
+                               lang('Strings') => array("string" => 65535, "text" => 65535),
+                               lang('Binary') => array("binary" => 255),
+                       ) as $key => $val
+               ) {
                        $types += $val;
                        $structured_types[$key] = array_keys($val);
                }
index 8938bd469309e74c16390f4292a4c1122f2d6f3a..02d3d4f0650d13e158639f08e906ce3288ab5892 100644 (file)
@@ -297,12 +297,14 @@ if (isset($_GET["simpledb"])) {
                        if (!$fast) {
                                $meta = sdb_request('DomainMetadata', array('DomainName' => $table));
                                if ($meta) {
-                                       foreach (array(
-                                               "Rows" => "ItemCount",
-                                               "Data_length" => "ItemNamesSizeBytes",
-                                               "Index_length" => "AttributeValuesSizeBytes",
-                                               "Data_free" => "AttributeNamesSizeBytes",
-                                       ) as $key => $val) {
+                                       foreach (
+                                               array(
+                                                       "Rows" => "ItemCount",
+                                                       "Data_length" => "ItemNamesSizeBytes",
+                                                       "Index_length" => "AttributeValuesSizeBytes",
+                                                       "Data_free" => "AttributeNamesSizeBytes",
+                                               ) as $key => $val
+                                       ) {
                                                $row[$key] = (string) $meta->$val;
                                        }
                                }