From ce81d0017408ea506d057eeb4289c3c793f0a12f Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Tue, 29 Oct 2019 03:52:58 -0400 Subject: [PATCH] Deprecate Parser::splitWhitespace() / Parser::createAssocArgs() These methods are not used anywhere in deployed code. Parser::createAssocArgs() is used in Extension:DataTable2, but it should just copy the implementation from Parser, it's very little code. Code search: https://codesearch.wmflabs.org/deployed/?q=splitWhitespace%7CcreateAssocArgs&i=nope&files=&repos= Bug: T236810 Change-Id: I4e6a39e2ecf7a3a568e26ad1d8ce1166a44a5ad9 (cherry picked from commit d7cd12e81ff6622bb5e14980297f926a3dec0984) --- RELEASE-NOTES-1.34 | 3 ++- includes/parser/Parser.php | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.34 b/RELEASE-NOTES-1.34 index 5fbd44451c..59e50d58e6 100644 --- a/RELEASE-NOTES-1.34 +++ b/RELEASE-NOTES-1.34 @@ -639,7 +639,8 @@ because of Phabricator reports. reasons and have been deprecated: doMagicLinks, doDoubleUnderscore, doHeadings, doAllQuotes, replaceExternalLinks, replaceInternalLinks, replaceInternalLinks2, getVariableValue, initialiseVariables, formatHeadings, - testPst, testPreprocess, testSrvus, areSubpagesAllowed, maybeDoSubpageLink. + testPst, testPreprocess, testSrvus, areSubpagesAllowed, maybeDoSubpageLink, + splitWhitespace, createAssocArgs. === Other changes in 1.34 === * Added option to specify "Various authors" as author in extension credits using diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index c5dd811c8a..2147f2f350 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3236,8 +3236,10 @@ class Parser { * @param string $s * * @return array + * @deprecated since 1.34; appears to be unused. */ public static function splitWhitespace( $s ) { + wfDeprecated( __METHOD__, '1.34' ); $ltrimmed = ltrim( $s ); $w1 = substr( $s, 0, strlen( $s ) - strlen( $ltrimmed ) ); $trimmed = rtrim( $ltrimmed ); @@ -3300,8 +3302,10 @@ class Parser { * @param array $args * * @return array + * @deprecated since 1.34; appears to be unused in core. */ public static function createAssocArgs( $args ) { + wfDeprecated( __METHOD__, '1.34' ); $assocArgs = []; $index = 1; foreach ( $args as $arg ) { -- 2.20.1