diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-09-07 22:14:04 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-09-07 22:14:04 +0300 |
commit | bc4fa31a063ff7e611a4e972cce494b2d806abc5 (patch) | |
tree | e71107aee786e17fc15012c9a911034a75b205ad /libraries | |
parent | a3ba333bfc9325b512807c155a1d75820ebd1f45 (diff) |
Add better type description for Dbal\DbalInterface::getTableIndexes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/classes/DatabaseInterface.php | 20 | ||||
-rw-r--r-- | libraries/classes/Dbal/DbalInterface.php | 20 | ||||
-rw-r--r-- | libraries/classes/Index.php | 2 |
3 files changed, 39 insertions, 3 deletions
diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index dffa2d285a..a053fb6d24 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -1018,7 +1018,25 @@ class DatabaseInterface implements DbalInterface * @param string $table name of the table whose indexes are to be retrieved * @param mixed $link mysql link resource * - * @return array + * @return array<int, array<string, string|null>> + * @psalm-return array<int, array{ + * Table: string, + * Non_unique: '0'|'1', + * Key_name: string, + * Seq_in_index: string, + * Column_name: string|null, + * Collation: 'A'|'D'|null, + * Cardinality: string, + * Sub_part: string|null, + * Packed: string|null, + * Null: string|null, + * Index_type: 'BTREE'|'FULLTEXT'|'HASH'|'RTREE', + * Comment: string, + * Index_comment: string, + * Ignored?: string, + * Visible?: string, + * Expression?: string|null + * }> */ public function getTableIndexes( string $database, diff --git a/libraries/classes/Dbal/DbalInterface.php b/libraries/classes/Dbal/DbalInterface.php index 2107a5dad3..d5722162c5 100644 --- a/libraries/classes/Dbal/DbalInterface.php +++ b/libraries/classes/Dbal/DbalInterface.php @@ -231,7 +231,25 @@ interface DbalInterface * @param string $table name of the table whose indexes are to be retrieved * @param mixed $link mysql link resource * - * @return array + * @return array<int, array<string, string|null>> + * @psalm-return array<int, array{ + * Table: string, + * Non_unique: '0'|'1', + * Key_name: string, + * Seq_in_index: string, + * Column_name: string|null, + * Collation: 'A'|'D'|null, + * Cardinality: string, + * Sub_part: string|null, + * Packed: string|null, + * Null: string|null, + * Index_type: 'BTREE'|'FULLTEXT'|'HASH'|'RTREE', + * Comment: string, + * Index_comment: string, + * Ignored?: string, + * Visible?: string, + * Expression?: string|null + * }> */ public function getTableIndexes( string $database, diff --git a/libraries/classes/Index.php b/libraries/classes/Index.php index abf51883b8..5fdb337fb4 100644 --- a/libraries/classes/Index.php +++ b/libraries/classes/Index.php @@ -239,7 +239,7 @@ class Index /** * Add column to index * - * @param string[] $params column params + * @param array<string, string|null> $params column params */ public function addColumn(array $params): void { |