/**
* Class to replace regex matches with a string similar to that used in preg_replace()
+ *
+ * @deprecated since 1.32, use a Closure instead
*/
class RegexlikeReplacer extends Replacer {
private $r;
* @param string $r
*/
public function __construct( $r ) {
+ wfDeprecated( __METHOD__, '1.32' );
$this->r = $r;
}
* @param array $matches
* @return string
*/
- public function replace( $matches ) {
- $pairs = array();
+ public function replace( array $matches ) {
+ $pairs = [];
foreach ( $matches as $i => $match ) {
$pairs["\$$i"] = $match;
}