ParserOutput::getExternalLinks(): Deprecate use of the internal array reference

In a future release this will return an array, not a reference to the
internal array, to maintain abstraction and allow for representation
changes internal to ParserOutput.

This patch just add deprecation notices to the class and to the
release notes.

Change-Id: Ie3a3f98402c5a5a3a92326d7736c0df874829a6b
This commit is contained in:
C. Scott Ananian 2024-10-21 12:41:27 -04:00 committed by Arlo Breault
parent ebdea35aeb
commit d0e0baf6a9
2 changed files with 9 additions and 0 deletions

View file

@ -1002,6 +1002,9 @@ because of Phabricator reports.
an empty array as an argument, not `null`.
* ParserOutput::setPageProperty() now emits deprecation warnings when called
with non-string values, which has been deprecated since 1.42.
* Use of the reference to the internal array returned by
ParserOutput::getExternalLinks() has been deprecated. In a future release
it will return a copy of the array.
* To support a future change allowing serializing of MessageValue objects
as JSON, the methods MessageValue::objectParams(), Message::objectParams()
and Message::objectParam() are deprecated. The UserGroupMembershipParam

View file

@ -901,6 +901,12 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
return $this->mFileSearchOptions;
}
/**
* @note Use of the reference returned by this method has been
* deprecated since 1.43. In a future release this will return a
* normal array. Use ::addExternalLink() to modify the set of
* external links stored in this ParserOutput.
*/
public function &getExternalLinks(): array {
return $this->mExternalLinks;
}