* Move description and ingroup annotations from PHP file docblock to
class docblock, where IDEs and Doxygen (and humans!) tend to read it
from.
This is in part evidences by the fact that for numerous classes,
the file docblock was copy-pasted and actually about a different
class.
Follows-up Ia3b9b8c22 (page), I301f471f86 (language),
I216d85c6df (PageEditStash), and others that apply similar doc
improvements.
* Add missing `@defgroup` for page. Without this, the group is ignored
and not added in the sidebar at
<https://doc.wikimedia.org/mediawiki-core/master/php/>
* Clean up the file header, similar to other commits under
<https://gerrit.wikimedia.org/r/q/message:ingroup+owner:Krinkle>.
Change-Id: I94de8299c184fee8c05b7108448255fcf36f8260
These two interfaces' methods have tentative return types in PHP 8.1,
which causes code without the type hints to raise warnings. Where the
type hint is "mixed", we need to use the special declaration
[\ReturnTypeWillChange] in a comment to suppress the warning as long as
we still support PHP < 8.0, which doesn't have a "mixed" type hint.
Bug: T289879
Change-Id: I1a126e602e92b8d13c7795eb6d790effd5ddc986
EditResultCache is meant to be an easy way for storing and retrieving
EditResults associated with revisions. It stores the data in the main
object stash which is supposed to be mostly persistent. In case the
main stash method fails, it falls back to trying to find the
EditResult in the ct_params field of revert change tags.
EditResultCache is to be used for delaying the execution of
RevertedTagUpdateJob until the edit is approved. The code for that
will be in the next commit in the relation chain.
This is a separate commit just for clarity.
Bug: T259103
Change-Id: I6c0c6556b6d98fcd131beb0957230ce7c7d268da
Updated the doc block to reflect the changes made in
I9279230303a01461039ae8a4641d9897ce194f73
Bug: T259014
Change-Id: I6aeec4ba75f1e5ac939ef526171d7268902f1f57
Serializable EditResult will be required to save it for later use by
RevertedTagUpdateJob.
Additionally I decided to save the serialization format version in
case we want to modify it in the future.
Bug: T259732
Change-Id: I0cddc9c0439c8a59b5f66cea9e7db5bb151cb53b
As the EditResult class changes a few things slightly and may be
a bit confusing for developers, I clarified it a bit in the
comments.
It would be probably useful to document this properly on mediawiki.org,
which I'll do once a few things with EditResult are sorted out.
Bug: T254074
Change-Id: Ic8d654ce2c10f079c5a3f417cb2dc0f6e5d7b5b2
EditResult is an immutable object created during a page update by
the PageUpdater using a builder object, the EditResultBuilder.
EditResult is a container for information on how the edit
interacted with the page and previous revisions. It also aims to
provide a standardized way of describing reverts and reverted
edits. It is as simple as possible, with no dependencies on the DB
or global variables. Most of the logic is encapsulated in the
builder.
PageUpdater::getEditResult() replaces the following methods:
* getOriginalRevisionId()
* getUndidRevisionId()
They are both available in the EditResult object.
PageUpdater::markAsRevert() replaces
PageUpdater::setUndidRevisionId()
Bug: T254074
Change-Id: Ie04c38043d9c295552e488109436ec1df20bb2ca