aboutsummaryrefslogtreecommitdiffstats
path: root/includes/libs/Message/MessageParam.php
Commit message (Collapse)AuthorAgeFilesLines
* includes/libs/Message: Add return type hints, update methodsDoğu Abaris2024-11-211-4/+3
| | | | | | | | | | | | | | | | | | | Applied return type hints to improve type safety in Message classes. Adjusted constructors to specify parameter types for consistency. Enhanced `newFromJsonArray` in `ScalarParam`, `DataMessageValue`, and `MessageParam` to clarify deserialization logic. Key updates: - Added `: string` return types for `getLangCode`, `getKey`, `dump`. - Added `: array` return type for `getParams`, `getData`, `toJsonArray`. - Revised `ScalarParam` JSON parsing to ensure a consistent return. These adjustments enhance type safety across the Message classes. Depends-On: Id7cc576693f5f1830e1d261cb13c626c901fb40f Depends-On: I260e3f526be10f7b11e5c77a1e300590c6fc5b2b Depends-On: I3c318273856d15407c71cb9b4ab7c23a0debb314 Change-Id: I7e50be91c01b4b70e1d1380651f001e35bd60523
* Make MessageValue JsonCodecable instead of JsonDeserializableIsabelle Hurbain-Palatin2024-10-281-4/+2
| | | | Change-Id: I8ed6498acb4657c69b58a24fc3cc45f585a31b7d
* libs: Add missing documentation to class propertiesUmherirrender2024-09-131-0/+2
| | | | | | | | | | Add doc-typehints to class properties found by the PropertyDocumentation sniff to improve the documentation. Once the sniff is enabled it avoids that new code is missing type declarations. This is focused on documentation and does not change code. Change-Id: I46f46f1855ca32c89a276b06f4e2051ff541886e
* Make MessageValue implement JsonDeserializableBartosz Dziewoński2024-06-121-2/+7
| | | | | | | | | | | | | | | MessageValue and friends are pure value objects and newable, so it makes sense for them to be (de)serializable too. There are some places where we want to serialize messages, such as in ParserOutput. The structure of the resulting JSON is inspired by the way we represent Message objects as plain values elsewhere in MediaWiki, e.g. StatusValue::getStatusArray(). Co-Authored-By: C. Scott Ananian <cscott@cscott.net> Depends-On: Ia32f95a6bdf342262b4ef044140527f0676402b9 Depends-On: I7bafe80cd36c2558517f474871148286350a4e76 Change-Id: Id47d58b5e26707fa0e0dbdd37418c0d54c8dd503
* libs/Message: Improve documentationBrad Jorsch2019-08-291-2/+4
| | | | | | | | | | | | Among other things, this removed mention of MediaWiki classes from the library and adds a README.md that attempts to define constraints for interoperability between libraries producing MessageValues and formatter implementations that are expected to handle them. This also renames "TextParam" to "ScalarParam", as that seems a more accurate name for the class. Change-Id: I264dd4de394d734a87929cf4740779e7b7d0e04a
* MessageFormatterFactoryTim Starling2019-08-281-0/+36
An injectable service interface for message formatting, somewhat narrowed compared to Message. Only the text format is implemented in this framework so far, with getTextFormatter() returning a formatter that converts to the text format. Other formatters could be added to MessageFormatterFactory. Bug: T226598 Change-Id: Id053074c1dbcb692e8309fdca602f94a385bca0c