From 7cca5dea0bbc7e75f0310dab73c8573e2a7a6b4b Mon Sep 17 00:00:00 2001 From: DannyS712 Date: Thu, 9 Sep 2021 00:56:11 +0000 Subject: [PATCH] TablePager: fix param documentation for formatValue() Can receive null value if the field isn't in the database result. Change-Id: Id995a384dc58f5d8216a7309490b98558004d071 --- includes/pager/TablePager.php | 3 ++- includes/specials/pagers/AllMessagesTablePager.php | 2 +- includes/specials/pagers/BlockListPager.php | 2 +- includes/specials/pagers/ImageListPager.php | 2 +- includes/specials/pagers/ProtectedPagesPager.php | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/pager/TablePager.php b/includes/pager/TablePager.php index 1896be026db..b57078717f3 100644 --- a/includes/pager/TablePager.php +++ b/includes/pager/TablePager.php @@ -465,7 +465,8 @@ abstract class TablePager extends IndexPager { * need more context. * * @param string $name The database field name - * @param string $value The value retrieved from the database + * @param string|null $value The value retrieved from the database, or null if + * the row doesn't contain this field */ abstract public function formatValue( $name, $value ); diff --git a/includes/specials/pagers/AllMessagesTablePager.php b/includes/specials/pagers/AllMessagesTablePager.php index 52f434eb4c0..5e19bfb66c8 100644 --- a/includes/specials/pagers/AllMessagesTablePager.php +++ b/includes/specials/pagers/AllMessagesTablePager.php @@ -273,7 +273,7 @@ class AllMessagesTablePager extends TablePager { /** * @param string $field - * @param string $value + * @param string|null $value * @return string HTML */ public function formatValue( $field, $value ) { diff --git a/includes/specials/pagers/BlockListPager.php b/includes/specials/pagers/BlockListPager.php index 70581ee0f3c..89f85d27f2d 100644 --- a/includes/specials/pagers/BlockListPager.php +++ b/includes/specials/pagers/BlockListPager.php @@ -121,7 +121,7 @@ class BlockListPager extends TablePager { /** * @param string $name - * @param string $value + * @param string|null $value * @return string * @suppress PhanTypeArraySuspicious */ diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index 963275644d8..faf15383834 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -454,7 +454,7 @@ class ImageListPager extends TablePager { /** * @param string $field - * @param string $value + * @param string|null $value * @return Message|string|int The return type depends on the value of $field: * - thumb: string * - img_timestamp: string diff --git a/includes/specials/pagers/ProtectedPagesPager.php b/includes/specials/pagers/ProtectedPagesPager.php index dd16497f1e9..37df13c1212 100644 --- a/includes/specials/pagers/ProtectedPagesPager.php +++ b/includes/specials/pagers/ProtectedPagesPager.php @@ -137,7 +137,7 @@ class ProtectedPagesPager extends TablePager { /** * @param string $field - * @param string $value + * @param string|null $value * @return string HTML * @throws MWException */