StringUtils: Deprecate Replacer classes
authorKevin Israel <pleasestand@live.com>
Tue, 10 Jul 2018 15:14:29 +0000 (11:14 -0400)
committerKunal Mehta <legoktm@member.fsf.org>
Thu, 12 Jul 2018 17:25:59 +0000 (10:25 -0700)
commit93fc424fc151865eb16ec3d29fd3224724ee2f21
tree0b61b4592e9754af8924f6d44da26daebe1f2660
parenta72fa4c99dd48dad8c05ca74cd007405c94a6d7a
StringUtils: Deprecate Replacer classes

The Replacer classes were added in 1.9, when MediaWiki supported PHP 5.0
and 5.1. They were designed to be used with preg_replace_callback() and
StringUtils::delimiterReplaceCallback(). Now that Closures exist in PHP
5.3 and newer, there is no need to define a class for this purpose.

All existing Replacer subclasses are simple enough that their few uses
can easily be replaced with Closures, without making the code harder to
understand. In fact, the code probably becomes easier to understand, as
what each match is replaced with becomes more obvious -- no need to
refer to a separate class.

MediaWiki code search finds no uses in extensions. Thus, these classes
are hard deprecated immediately.

Change-Id: I441c21689909fb06a1ea07a305259eeb82cb2345
RELEASE-NOTES-1.32
includes/libs/StringUtils.php
includes/libs/replacers/DoubleReplacer.php
includes/libs/replacers/HashtableReplacer.php
includes/libs/replacers/RegexlikeReplacer.php
includes/libs/replacers/Replacer.php
includes/parser/LinkHolderArray.php