1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-17 20:01:25 +02:00

Doc-comments: Use array shapes in @return

This uses https://phpstan.org/writing-php-code/phpdoc-types#array-shapes
I'm not going to do this in @param, it would be better to use https://phpstan.org/writing-php-code/phpdoc-types#global-type-aliases
This commit is contained in:
Jakub Vrana
2025-03-25 15:08:13 +01:00
parent 4d2b5144b1
commit 01e2fe4234
4 changed files with 15 additions and 15 deletions

View File

@@ -15,14 +15,14 @@ class Adminer {
}
/** Connection parameters
* @return array [$server, $username, $password]
* @return array{string, string, string}
*/
function credentials() {
return array(SERVER, $_GET["username"], get_password());
}
/** Get SSL connection options
* @return array ["key" => filename, "cert" => filename, "ca" => filename] or null
* @return string[] or null
*/
function connectSsl() {
}
@@ -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{keys:string[][], name:string}[]
*/
function backwardKeys($table, $tableName) {
return array();

View File

@@ -218,7 +218,7 @@ function edit_type($key, $field, $collations, $foreign_keys = array(), $extra_ty
/** Get partition info
* @param string
* @return array
* @return array{partition_by:string, partition:string, partitions:string, partition_names:list<string>, partition_values:list<string>}
*/
function get_partitions_info($table) {
global $connection;

View File

@@ -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[] same as table_status()
*/
function table_status1($table, $fast = false) {
$return = table_status($table, $fast);
@@ -724,7 +724,7 @@ function column_foreign_keys($table) {
}
/** Compute fields() from $_POST edit data
* @return array[]
* @return array[] same as fields()
*/
function fields_from_edit() {
global $driver;