Currently a number public RevisionStore methods accept Title or LinkTarget:
- ::getRevisionByTitle
- ::getRevisionByTimestamp
- ::newRevisionFromArchiveRow
- ::newRevisionFromArchiveRowAndSlots
- ::newRevisionsFromBatch
- ::newMutableRevisionFromArray - to be deprecated, see T272560
- ::getKnownCurrentRevision
- ::getFirstRevision
Some of these methods are inherited from various interfaces (RevisionFactory, RevisionLookup).
We need to accept PageIdentity in these methods as well, and soft-deprecate passing it Title object.
Additionally, some of these methods accept an array which can have a 'title' property - this should also be converted to accept PageIdentity as well as the Title under same key.
So, the LinkTarget parameter typehint should be removed for now (or changed to object) and the parameter declaration should be changed to
@param LinkTarget|PageIdentity $page the page this revision belongs to. Calling with LinkTarget is deprecated since 1.36
Internally, the methods should try using PageIdentity methods if possible with two exceptions:
- getId of PageIdentity has much stricter guarantees then Title::getArticleId, and since the calling code still passes Title, we have to still cast to Title via Title::castFromPageIdentity and call getArticleId. See RevisionRecord::getArticleId for example.
- If the called methods do not yet exist for PageIdentity, like Title::getLatestRevId, cast back to Title.
Tests for the converted methods should be adjusted to test both old interface (with Title) and new interface (with PageIdentityValue)
Note: EntitySchema extension extends RevisionLookup for testing purposes. This is not allowed by stable interface policy, so ArrayRevisionLookup should be changed into a mock before implementing this.