}
/** Fetch next row as associative array
- * @return array
+ * @return string[]
*/
function fetch_assoc() {
return mysql_fetch_assoc($this->result);
}
/** Fetch next row as numbered array
- * @return array
+ * @return list<string>
*/
function fetch_row() {
return mysql_fetch_row($this->result);
/** Get cached list of databases
* @param bool
- * @return array
+ * @return list<string>
*/
function get_databases($flush) {
// SHOW DATABASES can take a very long time so it is cached
}
/** Get tables list
- * @return array [$name => $type]
+ * @return string[] [$name => $type]
*/
function tables_list() {
return get_key_vals("SELECT TABLE_NAME, TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = DATABASE() ORDER BY TABLE_NAME");
/** Count tables in all databases
* @param array
- * @return array [$db => $tables]
+ * @return int[] [$db => $tables]
*/
function count_tables($databases) {
$return = array();
/** Get table status
* @param string
* @param bool return only "Name", "Engine" and "Comment" fields
- * @return array [$name => ["Name" => , "Engine" => , "Comment" => , "Oid" => , "Rows" => , "Collation" => , "Auto_increment" => , "Data_length" => , "Index_length" => , "Data_free" => ]] or only inner array with $name
+ * @return array[] [$name => ["Name" => , "Engine" => , "Comment" => , "Oid" => , "Rows" => , "Collation" => , "Auto_increment" => , "Data_length" => , "Index_length" => , "Data_free" => ]] or only inner array with $name
*/
function table_status($name = "", $fast = false) {
$return = array();
/** Get information about fields
* @param string
- * @return array [$name => ["field" =>, "full_type" =>, "type" =>, "length" =>, "unsigned" =>, "default" =>, "null" =>, "auto_increment" =>, "on_update" =>, "collation" =>, "privileges" =>, "comment" =>, "primary" =>, "generated" =>]]
+ * @return array[] [$name => ["field" =>, "full_type" =>, "type" =>, "length" =>, "unsigned" =>, "default" =>, "null" =>, "auto_increment" =>, "on_update" =>, "collation" =>, "privileges" =>, "comment" =>, "primary" =>, "generated" =>]]
*/
function fields($table) {
global $connection;
/** Get table indexes
* @param string
* @param string Db to use
- * @return array [$key_name => ["type" => , "columns" => [], "lengths" => [], "descs" => []]]
+ * @return array[] [$key_name => ["type" => , "columns" => [], "lengths" => [], "descs" => []]]
*/
function indexes($table, $connection2 = null) {
$return = array();
/** Get foreign keys in table
* @param string
- * @return array [$name => ["db" => , "ns" => , "table" => , "source" => [], "target" => [], "on_delete" => , "on_update" => ]]
+ * @return array[] [$name => ["db" => , "ns" => , "table" => , "source" => [], "target" => [], "on_delete" => , "on_update" => ]]
*/
function foreign_keys($table) {
global $driver;
}
/** Get sorted grouped list of collations
- * @return array
+ * @return list<string>[]
*/
function collations() {
$return = array();
}
ksort($return);
foreach ($return as $key => $val) {
- asort($return[$key]);
+ sort($return[$key]);
}
return $return;
}
/** Get defined triggers
* @param string
- * @return array [$name => [$timing, $event]]
+ * @return array[] [$name => [$timing, $event]]
*/
function triggers($table) {
$return = array();
}
/** Get trigger options
- * @return array ["Timing" => [], "Event" => [], "Type" => []]
+ * @return list<string>[] ["Timing" => [], "Event" => [], "Type" => []]
*/
function trigger_options() {
return array(
}
/** Get list of routines
- * @return array ["SPECIFIC_NAME" => , "ROUTINE_NAME" => , "ROUTINE_TYPE" => , "DTD_IDENTIFIER" => ]
+ * @return list<string[]> ["SPECIFIC_NAME" => , "ROUTINE_NAME" => , "ROUTINE_TYPE" => , "DTD_IDENTIFIER" => ]
*/
function routines() {
return get_rows("SELECT ROUTINE_NAME AS SPECIFIC_NAME, ROUTINE_NAME, ROUTINE_TYPE, DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA = DATABASE()");
}
/** Get list of available routine languages
- * @return array
+ * @return list<string>
*/
function routine_languages() {
return array(); // "SQL" not required
/* Not used is MySQL but checked in compile.php:
/** Get user defined types
- * @return array [$id => $name]
+ * @return string[] [$id => $name]
function types() {
return array();
}
}
/** Get existing schemas
- * @return array
+ * @return list<string>
function schemas() {
return array();
}
}
/** Get server variables
- * @return array [[$name, $value]]
+ * @return list<string[]> [[$name, $value]]
*/
function show_variables() {
return get_rows("SHOW VARIABLES");
}
/** Get status variables
- * @return array [[$name, $value]]
+ * @return list<string[]> [[$name, $value]]
*/
function show_status() {
return get_rows("SHOW STATUS");
}
/** Get process list
- * @return array [$row]
+ * @return list<string[]> [$row]
*/
function process_list() {
return get_rows("SHOW FULL PROCESSLIST");
/** Get cached list of databases
* @param bool
- * @return array
+ * @return list<string>
*/
function databases($flush = true) {
return get_databases($flush);
}
/** Get list of schemas
- * @return array
+ * @return list<string>
*/
function schemas() {
return schemas();
}
/** Get Content Security Policy headers
- * @return array of arrays with directive name in key, allowed sources in value
+ * @return list<string[]> of arrays with directive name in key, allowed sources in value
*/
function csp() {
return csp();
}
/** Get URLs of the CSS files
- * @return array of strings
+ * @return list<string>
*/
function css() {
$return = array();
/** Get foreign keys for table
* @param string
- * @return array same format as foreign_keys()
+ * @return array[] same format as foreign_keys()
*/
function foreignKeys($table) {
return foreign_keys($table);
/** Find backward keys for table
* @param string
* @param string
- * @return array $return[$target_table]["keys"][$key_name][$target_column] = $source_column; $return[$target_table]["name"] = $this->tableName($target_table);
+ * @return array[] $return[$target_table]["keys"][$key_name][$target_column] = $source_column; $return[$target_table]["name"] = $this->tableName($target_table);
*/
function backwardKeys($table, $tableName) {
return array();
/** Get descriptions of selected data
* @param array all data to print
* @param array
- * @return array
+ * @return list<string[]>
*/
function rowDescriptions($rows, $foreignKeys) {
return $rows;
/** Process columns box in select
* @param array selectable columns
* @param array
- * @return array [[select_expressions], [group_expressions]]
+ * @return list<list<string>> [[select_expressions], [group_expressions]]
*/
function selectColumnsProcess($columns, $indexes) {
global $driver;
/** Process search box in select
* @param array
* @param array
- * @return array expressions to join by AND
+ * @return list<string> expressions to join by AND
*/
function selectSearchProcess($fields, $indexes) {
global $connection, $driver;
/** Process order box in select
* @param array
* @param array
- * @return array expressions to join by comma
+ * @return list<string> expressions to join by comma
*/
function selectOrderProcess($fields, $indexes) {
$return = array();
/** Functions displayed in edit form
* @param array single field from fields()
- * @return array
+ * @return list<string>
*/
function editFunctions($field) {
global $driver;
}
/** Return export output options
- * @return array
+ * @return string[]
*/
function dumpOutput() {
$return = array('text' => lang('open'), 'file' => lang('save'));
}
/** Return export format options
- * @return array empty to disable export
+ * @return string[] empty to disable export
*/
function dumpFormat() {
return (support("dump") ? array('sql' => 'SQL') : array()) + array('csv' => 'CSV,', 'csv;' => 'CSV;', 'tsv' => 'TSV');
}
/** Get Content Security Policy headers
-* @return array of arrays with directive name in key, allowed sources in value
+* @return list<string[]> of arrays with directive name in key, allowed sources in value
*/
function csp() {
return array(
}
/** Get all types
- * @return array [$type => $maximum_unsigned_length, ...]
+ * @return int[] [$type => $maximum_unsigned_length, ...]
*/
function types() {
return call_user_func_array('array_merge', array_values($this->types));
}
/** Get structured types
- * @return array [$description => [$type, ...], ...]
+ * @return list<string>[] [$description => [$type, ...], ...]
*/
function structuredTypes() {
return array_map('array_keys', $this->types);
}
/** Get supported engines
- * @return array
+ * @return list<string>
*/
function engines() {
return array();
/** Get defined check constraints
* @param string
- * @return array [$name => $clause]
+ * @return string[] [$name => $clause]
*/
function checkConstraints($table) {
// MariaDB contains CHECK_CONSTRAINTS.TABLE_NAME, MySQL and PostrgreSQL not
/** Print select result
* @param Result
* @param Db connection to examine indexes
-* @param array
+* @param string[]
* @param int
-* @return array $orgtables
+* @return string[] $orgtables
*/
function select($result, $connection2 = null, $orgtables = array(), $limit = 0) {
$links = array(); // colno => orgtable - create links from these columns
/** Get referencable tables with single column primary key except self
* @param string
-* @return array [$table_name => $field]
+* @return array[] [$table_name => $field]
*/
function referencable_primary($self) {
$return = array(); // table_name => field
/** Create SQL string from field
* @param array basic field information
* @param array information about field type
-* @return array ["field", "type", "NULL", "DEFAULT", "ON UPDATE", "COMMENT", "AUTO_INCREMENT"]
+* @return list<string> ["field", "type", "NULL", "DEFAULT", "ON UPDATE", "COMMENT", "AUTO_INCREMENT"]
*/
function process_field($field, $type_field) {
// MariaDB exports CURRENT_TIMESTAMP as a function.
/** Get list of values from database
* @param string
* @param mixed
-* @return array
+* @return list<string>
*/
function get_vals($query, $column = 0) {
global $connection;
* @param string
* @param Db
* @param bool
-* @return array
+* @return string[]
*/
function get_key_vals($query, $connection2 = null, $set_keys = true) {
global $connection;
* @param string
* @param Db
* @param string
-* @return array of associative arrays
+* @return list<string[]> of associative arrays
*/
function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
global $connection;
/** Find unique identifier of a row
* @param array
* @param array result of indexes()
-* @return array or null if there is no unique identifier
+* @return string[] or null if there is no unique identifier
*/
function unique_array($row, $indexes) {
foreach ($indexes as $index) {
/** Get settings stored in a cookie
* @param string
-* @return array
+* @return mixed[]
*/
function get_settings($cookie) {
parse_str($_COOKIE[$cookie], $settings);
}
/** Store settings to a cookie
-* @param array
+* @param mixed[]
* @param string
* @return bool
*/
/** Get status of a single table and fall back to name on error
* @param string
* @param bool
-* @return array
+* @return array[]
*/
function table_status1($table, $fast = false) {
$return = table_status($table, $fast);
/** Find out foreign keys for each column
* @param string
-* @return array [$col => []]
+* @return list<string>[] [$col => []]
*/
function column_foreign_keys($table) {
global $adminer;
}
/** Compute fields() from $_POST edit data
-* @return array
+* @return array[]
*/
function fields_from_edit() {
global $driver;
/** Run query which can be killed by AJAX call after timing out
* @param string
-* @return array of strings
+* @return string[]
*/
function slow_query($query) {
global $adminer, $token, $driver;