mirror of
https://github.com/vrana/adminer.git
synced 2025-08-17 20:01:25 +02:00
Doc-comments: Improve array @return
This commit is contained in:
@@ -60,14 +60,14 @@ class Adminer {
|
||||
|
||||
/** 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();
|
||||
@@ -87,7 +87,7 @@ class Adminer {
|
||||
}
|
||||
|
||||
/** 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();
|
||||
@@ -105,7 +105,7 @@ class Adminer {
|
||||
}
|
||||
|
||||
/** Get URLs of the CSS files
|
||||
* @return array of strings
|
||||
* @return list<string>
|
||||
*/
|
||||
function css() {
|
||||
$return = array();
|
||||
@@ -211,7 +211,7 @@ class Adminer {
|
||||
|
||||
/** 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);
|
||||
@@ -220,7 +220,7 @@ class Adminer {
|
||||
/** 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();
|
||||
@@ -279,7 +279,7 @@ class Adminer {
|
||||
/** Get descriptions of selected data
|
||||
* @param array all data to print
|
||||
* @param array
|
||||
* @return array
|
||||
* @return list<string[]>
|
||||
*/
|
||||
function rowDescriptions($rows, $foreignKeys) {
|
||||
return $rows;
|
||||
@@ -532,7 +532,7 @@ class Adminer {
|
||||
/** 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;
|
||||
@@ -552,7 +552,7 @@ class Adminer {
|
||||
/** 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;
|
||||
@@ -606,7 +606,7 @@ class Adminer {
|
||||
/** 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();
|
||||
@@ -699,7 +699,7 @@ class Adminer {
|
||||
|
||||
/** Functions displayed in edit form
|
||||
* @param array single field from fields()
|
||||
* @return array
|
||||
* @return list<string>
|
||||
*/
|
||||
function editFunctions($field) {
|
||||
global $driver;
|
||||
@@ -779,7 +779,7 @@ class Adminer {
|
||||
}
|
||||
|
||||
/** Return export output options
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
function dumpOutput() {
|
||||
$return = array('text' => lang('open'), 'file' => lang('save'));
|
||||
@@ -790,7 +790,7 @@ class Adminer {
|
||||
}
|
||||
|
||||
/** 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');
|
||||
|
@@ -149,7 +149,7 @@ function page_headers() {
|
||||
}
|
||||
|
||||
/** 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(
|
||||
|
@@ -46,14 +46,14 @@ abstract class SqlDriver {
|
||||
}
|
||||
|
||||
/** 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);
|
||||
@@ -253,7 +253,7 @@ abstract class SqlDriver {
|
||||
}
|
||||
|
||||
/** Get supported engines
|
||||
* @return array
|
||||
* @return list<string>
|
||||
*/
|
||||
function engines() {
|
||||
return array();
|
||||
@@ -269,7 +269,7 @@ abstract class SqlDriver {
|
||||
|
||||
/** 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
|
||||
|
@@ -6,9 +6,9 @@ namespace Adminer;
|
||||
/** 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
|
||||
@@ -102,7 +102,7 @@ function select($result, $connection2 = null, $orgtables = array(), $limit = 0)
|
||||
|
||||
/** 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
|
||||
@@ -262,7 +262,7 @@ function process_type($field, $collate = "COLLATE") {
|
||||
/** 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.
|
||||
|
@@ -200,7 +200,7 @@ function get_val($query, $field = 0) {
|
||||
/** Get list of values from database
|
||||
* @param string
|
||||
* @param mixed
|
||||
* @return array
|
||||
* @return list<string>
|
||||
*/
|
||||
function get_vals($query, $column = 0) {
|
||||
global $connection;
|
||||
@@ -218,7 +218,7 @@ function get_vals($query, $column = 0) {
|
||||
* @param string
|
||||
* @param Db
|
||||
* @param bool
|
||||
* @return array
|
||||
* @return string[]
|
||||
*/
|
||||
function get_key_vals($query, $connection2 = null, $set_keys = true) {
|
||||
global $connection;
|
||||
@@ -243,7 +243,7 @@ function get_key_vals($query, $connection2 = null, $set_keys = true) {
|
||||
* @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;
|
||||
@@ -263,7 +263,7 @@ function get_rows($query, $connection2 = null, $error = "<p class='error'>") {
|
||||
/** 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) {
|
||||
@@ -381,7 +381,7 @@ function cookie($name, $value, $lifetime = 2592000) {
|
||||
|
||||
/** Get settings stored in a cookie
|
||||
* @param string
|
||||
* @return array
|
||||
* @return mixed[]
|
||||
*/
|
||||
function get_settings($cookie) {
|
||||
parse_str($_COOKIE[$cookie], $settings);
|
||||
@@ -399,7 +399,7 @@ function get_setting($key, $cookie = "adminer_settings") {
|
||||
}
|
||||
|
||||
/** Store settings to a cookie
|
||||
* @param array
|
||||
* @param mixed[]
|
||||
* @param string
|
||||
* @return bool
|
||||
*/
|
||||
@@ -701,7 +701,7 @@ function friendly_url($val) {
|
||||
/** 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);
|
||||
@@ -710,7 +710,7 @@ function table_status1($table, $fast = false) {
|
||||
|
||||
/** Find out foreign keys for each column
|
||||
* @param string
|
||||
* @return array [$col => []]
|
||||
* @return list<string>[] [$col => []]
|
||||
*/
|
||||
function column_foreign_keys($table) {
|
||||
global $adminer;
|
||||
@@ -724,7 +724,7 @@ function column_foreign_keys($table) {
|
||||
}
|
||||
|
||||
/** Compute fields() from $_POST edit data
|
||||
* @return array
|
||||
* @return array[]
|
||||
*/
|
||||
function fields_from_edit() {
|
||||
global $driver;
|
||||
@@ -977,7 +977,7 @@ function count_rows($table, $where, $is_group, $group) {
|
||||
|
||||
/** 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;
|
||||
|
Reference in New Issue
Block a user