Deprecate Parser::splitWhitespace() / Parser::createAssocArgs()
authorC. Scott Ananian <cscott@cscott.net>
Tue, 29 Oct 2019 07:52:58 +0000 (03:52 -0400)
committerJames D. Forrester <jforrester@wikimedia.org>
Wed, 30 Oct 2019 21:34:47 +0000 (14:34 -0700)
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
includes/parser/Parser.php

index 5fbd444..59e50d5 100644 (file)
@@ -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
index c5dd811..2147f2f 100644 (file)
@@ -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 ) {