From 746d1696b703b626bddb1e33c76992078f8454da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Meneghini=20Fauth?= Date: Fri, 9 Sep 2022 09:04:21 -0300 Subject: Improve type declaration of Index::getCompareData method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: MaurĂ­cio Meneghini Fauth --- libraries/classes/Index.php | 17 ++++++++++++++--- libraries/classes/IndexColumn.php | 11 +++++++++-- 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'libraries') diff --git a/libraries/classes/Index.php b/libraries/classes/Index.php index b664ee0d8c..94cb50b641 100644 --- a/libraries/classes/Index.php +++ b/libraries/classes/Index.php @@ -548,9 +548,20 @@ class Index /** * Gets the properties in an array for comparison purposes * - * @return array an array containing the properties of the index - */ - public function getCompareData() + * @return array>|string|null> + * @psalm-return array{ + * Packed: string|null, + * Index_choice: string, + * columns?: list + * } + */ + public function getCompareData(): array { $data = [ 'Packed' => $this->packed, diff --git a/libraries/classes/IndexColumn.php b/libraries/classes/IndexColumn.php index 4921002f32..adfca050c8 100644 --- a/libraries/classes/IndexColumn.php +++ b/libraries/classes/IndexColumn.php @@ -191,9 +191,16 @@ class IndexColumn /** * Gets the properties in an array for comparison purposes * - * @return array an array containing the properties of the index column + * @return array + * @psalm-return array{ + * Column_name: string, + * Seq_in_index: int, + * Collation: string|null, + * Sub_part: int|null, + * Null: string + * } */ - public function getCompareData() + public function getCompareData(): array { return [ 'Column_name' => $this->name, -- cgit v1.2.3