Page MenuHomePhabricator

Make private methods of Parser.php actually private
Open, MediumPublic

Description

A number of the methods in Parser.php are unused outside the class itself, but are public for historical reasons.

We need to first deprecate these, then eventually make them private.

Details

SubjectRepoBranchLines +/-
mediawiki/coreREL1_42+6 -2
mediawiki/coreREL1_42+3 -1
mediawiki/coreREL1_42+4 -2
mediawiki/coreREL1_42+16 -6
mediawiki/coremaster+6 -2
mediawiki/coremaster+4 -2
mediawiki/coremaster+3 -1
mediawiki/coremaster+16 -6
mediawiki/coremaster+14 -21
mediawiki/coremaster+33 -400
mediawiki/coreREL1_34+98 -16
mediawiki/coreREL1_34+251 -43
mediawiki/coreREL1_34+31 -4
mediawiki/coreREL1_34+6 -1
mediawiki/coreREL1_34+15 -4
mediawiki/coremaster+30 -4
mediawiki/coremaster+6 -1
mediawiki/coremaster+100 -17
mediawiki/coremaster+15 -4
mediawiki/extensions/DataTable2master+31 -1
mediawiki/coremaster+251 -43
mediawiki/coremaster+11 -1
Show related patches Customize query in gerrit

Event Timeline

Change 546793 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Deprecate Parser implementation methods (will be private in next release)

https://gerrit.wikimedia.org/r/546793

Change 546967 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Deprecate Parser::areSubpagesAllowed() / Parser::maybeDoSubpageLink()

https://gerrit.wikimedia.org/r/546967

Change 546968 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Deprecate Parser::armorLinks() / Parser::makeKnownLinkHolder()

https://gerrit.wikimedia.org/r/546968

Change 546969 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Deprecate Parser::splitWhitespace() / Parser::createAssocArgs()

https://gerrit.wikimedia.org/r/546969

Change 546981 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Deprecate Parser::replaceLinkHolders/replaceLinkHoldersText

https://gerrit.wikimedia.org/r/546981

Change 546982 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Deprecate Parser::getImageParams()

https://gerrit.wikimedia.org/r/546982

Change 546982 abandoned by C. Scott Ananian:
Deprecate Parser::getImageParams()

Reason:
squashed into I44458490fa86abd0ead048a4c94021da6be333f0

https://gerrit.wikimedia.org/r/546982

@cscott I was wondering if there is a preferred migration path away from Parser::replaceLinkHolders for code that relied on it. I see that the mLinkHolders field in Parser is public, but I imagine that won't stay that way either, right? Thanks in advance!

Change 547048 had a related patch set uploaded (by Krinkle; owner: C. Scott Ananian):
[mediawiki/core@REL1_34] Deprecate Parser implementation methods (will be private in next release)

https://gerrit.wikimedia.org/r/547048

Change 547048 merged by jenkins-bot:
[mediawiki/core@REL1_34] Deprecate Parser implementation methods (will be private in next release)

https://gerrit.wikimedia.org/r/547048

Change 546793 merged by jenkins-bot:
[mediawiki/core@master] Deprecate Parser implementation methods (will be private in next release)

https://gerrit.wikimedia.org/r/546793

Change 547259 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/extensions/DataTable2@master] Stop using the deprecated Parser::createAssocArgs() function from core

https://gerrit.wikimedia.org/r/547259

Change 547259 merged by jenkins-bot:
[mediawiki/extensions/DataTable2@master] Stop using the deprecated Parser::createAssocArgs() function from core

https://gerrit.wikimedia.org/r/547259

Change 546967 merged by jenkins-bot:
[mediawiki/core@master] Deprecate Parser::areSubpagesAllowed() / Parser::maybeDoSubpageLink()

https://gerrit.wikimedia.org/r/546967

Change 546969 merged by jenkins-bot:
[mediawiki/core@master] Deprecate Parser::splitWhitespace() / Parser::createAssocArgs()

https://gerrit.wikimedia.org/r/546969

Change 546968 merged by jenkins-bot:
[mediawiki/core@master] Deprecate additional public methods of Parser

https://gerrit.wikimedia.org/r/546968

Change 546981 merged by jenkins-bot:
[mediawiki/core@master] Deprecate Parser::replaceLinkHolders / replaceLinkHoldersText

https://gerrit.wikimedia.org/r/546981

Change 547315 had a related patch set uploaded (by Jforrester; owner: C. Scott Ananian):
[mediawiki/core@REL1_34] Deprecate Parser::areSubpagesAllowed() / Parser::maybeDoSubpageLink()

https://gerrit.wikimedia.org/r/547315

Change 547316 had a related patch set uploaded (by Jforrester; owner: C. Scott Ananian):
[mediawiki/core@REL1_34] Deprecate Parser::splitWhitespace() / Parser::createAssocArgs()

https://gerrit.wikimedia.org/r/547316

Change 547317 had a related patch set uploaded (by Jforrester; owner: C. Scott Ananian):
[mediawiki/core@REL1_34] Deprecate Parser::replaceLinkHolders / replaceLinkHoldersText

https://gerrit.wikimedia.org/r/547317

Change 547318 had a related patch set uploaded (by Jforrester; owner: C. Scott Ananian):
[mediawiki/core@REL1_34] Deprecate additional public methods of Parser

https://gerrit.wikimedia.org/r/547318

Change 547315 merged by jenkins-bot:
[mediawiki/core@REL1_34] Deprecate Parser::areSubpagesAllowed() / Parser::maybeDoSubpageLink()

https://gerrit.wikimedia.org/r/547315

Change 547316 merged by jenkins-bot:
[mediawiki/core@REL1_34] Deprecate Parser::splitWhitespace() / Parser::createAssocArgs()

https://gerrit.wikimedia.org/r/547316

Change 547317 merged by jenkins-bot:
[mediawiki/core@REL1_34] Deprecate Parser::replaceLinkHolders / replaceLinkHoldersText

https://gerrit.wikimedia.org/r/547317

Change 547318 merged by jenkins-bot:
[mediawiki/core@REL1_34] Deprecate additional public methods of Parser

https://gerrit.wikimedia.org/r/547318

Change 548458 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Parser: remove/make private historically-public methods

https://gerrit.wikimedia.org/r/548458

Change 548458 merged by jenkins-bot:
[mediawiki/core@master] Parser: remove/make private historically-public methods

https://gerrit.wikimedia.org/r/548458

@cscott I was wondering if there is a preferred migration path away from Parser::replaceLinkHolders for code that relied on it. I see that the mLinkHolders field in Parser is public, but I imagine that won't stay that way either, right? Thanks in advance!

Good question. I haven't quite figured that out yet. You're right that public mLinkHolders needs to go away. Parsoid doesn't have any corresponding concept for "link holders"; we need to figure out if that needs to be added to Parsoid and/or replaced with something different for the eventual parser migration.

ssastry triaged this task as Medium priority.

Hi folks, I see mLinkHolders is now private, and that Parser::replaceLinkHolders has a deprecation tag in its comment. Is there at this stage a recommended alternative for parsing linkHolders in a string that an extension has? If not, is there any other way to go about doing so, without having to re-parse the entire content within which the links are held?

Change 832494 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Make private deprecated public properties of Parser

https://gerrit.wikimedia.org/r/832494

Change 832494 merged by jenkins-bot:

[mediawiki/core@master] Make private deprecated public properties of Parser

https://gerrit.wikimedia.org/r/832494

@cscott: Hi, all related patches in Gerrit have been merged. Can this task be resolved (via Add Action...Change Status in the dropdown menu), or is there more to do in this task? Asking as you are set as task assignee. Thanks in advance!

@cscott: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on Feburary 22nd, 2023.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!

Change 1004158 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] [Parser] Emit warnings for accesses to deprecated $ot property

https://gerrit.wikimedia.org/r/1004158

Change 1004162 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] [Parser] Emit warnings for accesses to deprecated $mTitle property

https://gerrit.wikimedia.org/r/1004162

Change 1004163 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] [Parser] Emit warnings for accesses to deprecated $mOptions property

https://gerrit.wikimedia.org/r/1004163

Change #1019355 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] [Parser] Mark $mPPNodeCount and $mHighestExpansionDepth @internal

https://gerrit.wikimedia.org/r/1019355

Change #1004158 merged by jenkins-bot:

[mediawiki/core@master] [Parser] Emit warnings for accesses to deprecated $ot property

https://gerrit.wikimedia.org/r/1004158

Change #1004162 merged by jenkins-bot:

[mediawiki/core@master] [Parser] Emit warnings for accesses to deprecated $mTitle property

https://gerrit.wikimedia.org/r/1004162

Change #1004163 merged by jenkins-bot:

[mediawiki/core@master] [Parser] Emit warnings for accesses to deprecated $mOptions property

https://gerrit.wikimedia.org/r/1004163

Change #1019355 merged by jenkins-bot:

[mediawiki/core@master] [Parser] Mark $mPPNodeCount and $mHighestExpansionDepth @internal

https://gerrit.wikimedia.org/r/1019355

Change #1019871 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@REL1_42] [Parser] Emit warnings for accesses to deprecated $ot property

https://gerrit.wikimedia.org/r/1019871

Change #1019872 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@REL1_42] [Parser] Emit warnings for accesses to deprecated $mTitle property

https://gerrit.wikimedia.org/r/1019872

Change #1019873 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@REL1_42] [Parser] Emit warnings for accesses to deprecated $mOptions property

https://gerrit.wikimedia.org/r/1019873

Change #1019874 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@REL1_42] [Parser] Mark $mPPNodeCount and $mHighestExpansionDepth @internal

https://gerrit.wikimedia.org/r/1019874

Change #1019871 merged by jenkins-bot:

[mediawiki/core@REL1_42] [Parser] Emit warnings for accesses to deprecated $ot property

https://gerrit.wikimedia.org/r/1019871

Change #1019872 merged by jenkins-bot:

[mediawiki/core@REL1_42] [Parser] Emit warnings for accesses to deprecated $mTitle property

https://gerrit.wikimedia.org/r/1019872

Change #1019873 merged by jenkins-bot:

[mediawiki/core@REL1_42] [Parser] Emit warnings for accesses to deprecated $mOptions property

https://gerrit.wikimedia.org/r/1019873

Change #1019874 merged by jenkins-bot:

[mediawiki/core@REL1_42] [Parser] Mark $mPPNodeCount and $mHighestExpansionDepth @internal

https://gerrit.wikimedia.org/r/1019874