From 0a677f467527ab462fcbcdbff28880271ffc92cb Mon Sep 17 00:00:00 2001 From: Ammarpad Date: Thu, 24 Oct 2024 22:53:48 +0100 Subject: [PATCH] fix ::getTruncatedSectionTitle() return type This method can return false if getParsedSectionTitle() returns false Both Language::embedBidi and Language::truncateForVisual return non-string primitives unchanged if they're passed to them as first argument. Ideally the Language methods arguments should be string-typed but I am not sure how easy that change would be now, so better to document the possibility here. Change-Id: I7e2856862d6508ecd1aa57ad99b92942bc4d7bed --- includes/Formatters/EchoPresentationModelSection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/Formatters/EchoPresentationModelSection.php b/includes/Formatters/EchoPresentationModelSection.php index 87680b59c..643e988ab 100644 --- a/includes/Formatters/EchoPresentationModelSection.php +++ b/includes/Formatters/EchoPresentationModelSection.php @@ -127,7 +127,7 @@ class EchoPresentationModelSection { /** * Get truncated section title, according to user's language. * You should only call this if EchoPresentationModelSection::exists returns true. - * @return string + * @return string|false */ public function getTruncatedSectionTitle() { return $this->language->embedBidi( $this->language->truncateForVisual(