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
This commit is contained in:
Ammarpad 2024-10-24 22:53:48 +01:00
parent a76cc44a60
commit 0a677f4675

View file

@ -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(