ParserOutput::setUnindexedPageProperty(): use empty string as default value

If a placeholder value is needed, it is recommended to use the empty string
to avoid wasting database space unnecessarily.  Operationalize this
recommendation by providing a default value for the method argument.

Bug: T305158
Bug: T350224
Change-Id: I9ea8d93298d771c2d38fdfb451a2817220ca679a
This commit is contained in:
C. Scott Ananian 2024-04-11 11:58:13 -04:00
parent 0721b0af62
commit b4721e24aa

View file

@ -1556,13 +1556,14 @@ class ParserOutput extends CacheTime implements ContentMetadataCollector {
/**
* Set a page property which is *not* intended to be indexed.
*
* See `::setPageProperty()` for details.
* See `::setPageProperty()` for details. It is recommended to
* use the empty string if you need a placeholder value.
*
* @param string $name
* @param string $value
* @param string $value Optional value; defaults to the empty string.
* @since 1.42
*/
public function setUnindexedPageProperty( string $name, string $value ): void {
public function setUnindexedPageProperty( string $name, string $value = '' ): void {
$this->mProperties[$name] = $value;
}