1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 08:06:59 +02:00

Doc-comment: Improve array @param

This uses syntax from https://phpstan.org/writing-php-code/phpdoc-types#general-arrays.

int[] means an array of ints with arbitrary keys (usually strings)
list<string> means an array of strings with sequential integer keys starting at 0
list<string>[] means an arbitrary array of string lists
list<string[]> means list of arbitrary string arrays
string[][] means two dimensional array with arbitrary keys in both dimensions
array was left in the comments for https://phpstan.org/writing-php-code/phpdoc-types#array-shapes
This commit is contained in:
Jakub Vrana
2025-03-25 14:31:27 +01:00
parent 26aa48122f
commit 2ee325183b
17 changed files with 97 additions and 97 deletions

View File

@@ -10,7 +10,7 @@ class AdminerDatabaseHide {
protected $disabled;
/**
* @param array case insensitive database names in values
* @param list<string> case insensitive database names in values
*/
function __construct($disabled) {
$this->disabled = array_map('strtolower', $disabled);

View File

@@ -10,7 +10,7 @@ class AdminerDesigns {
protected $designs;
/**
* @param array URL in key, name in value
* @param list<string> URL in key, name in value
*/
function __construct($designs) {
$this->designs = $designs;

View File

@@ -10,8 +10,8 @@ class AdminerLoginIp {
protected $ips, $forwarded_for;
/** Set allowed IP addresses
* @param array IP address prefixes
* @param array X-Forwarded-For prefixes if IP address matches, empty array means anything
* @param list<string> IP address prefixes
* @param list<string> X-Forwarded-For prefixes if IP address matches, empty array means anything
*/
function __construct($ips, $forwarded_for = array()) {
$this->ips = $ips;

View File

@@ -10,7 +10,7 @@ class AdminerLoginServers {
protected $servers;
/** Set supported servers
* @param array [$description => ["server" => , "driver" => "server|pgsql|sqlite|..."]]
* @param array[] [$description => ["server" => , "driver" => "server|pgsql|sqlite|..."]]
*/
function __construct($servers) {
$this->servers = $servers;

View File

@@ -10,7 +10,7 @@ class AdminerMasterSlave {
private $masters = array();
/**
* @param array [$slave => $master]
* @param string[] [$slave => $master]
*/
function __construct($masters) {
$this->masters = $masters;

View File

@@ -9,7 +9,7 @@
class AdminerTableIndexesStructure {
/** Print table structure in tabular format
* @Param array data about all indexes on a table
* @param array[] data about all indexes on a table
* @return bool
*/
function tableIndexesPrint($indexes) {

View File

@@ -9,7 +9,7 @@
class AdminerTableStructure {
/** Print table structure in tabular format
* @param array data about individual fields
* @param array[] data about individual fields
* @return bool
*/
function tableStructurePrint($fields, $tableStatus = null) {

View File

@@ -11,7 +11,7 @@ class AdminerWymeditor {
protected $scripts, $options;
/**
* @param array
* @param list<string>
* @param string in format "skin: 'custom', preInit: function () { }"
*/
function __construct($scripts = array("jquery/jquery.js", "wymeditor/jquery.wymeditor.min.js"), $options = "") {