Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I73fb416573f5af600e529d224b5beb5d2e3d27d3
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
This patch introduces a namespace, MediaWiki\RevisionList, and adds it
to the related classes and establishes class aliases marked as
deprecated since version 1.43.
Bug: T353458
Change-Id: I1614a00dd8973c5300d95317a725cbe46e14d1af
This patch introduces a new namespace declaration,
MediaWiki\Xml and adds Xml and XmlSelect to it
and establishes class aliases marked as deprecated
since version 1.43.
Bug: T353458
Change-Id: I45cccd540b6e15f267d3ab588a064fbeb719d921
If we are serious about getting rid of wfGetDB(), we should start
replcing callers with proper replacement.
These classes don't have any injection so it doesn't make sense to
introduce it for this specific usecase.
Bug: T330641
Change-Id: I645f67324d441288c63787c7e42390b59106c585
Some less trivial cases. Also update variable names.
This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.
Follow-up to 8604c384f6.
Change-Id: I6657d783375fac5c7fa856b884ff1fb09285e94c
Found via (?<!IDBAccessObject)::READ_
We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.
Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
This revision updates RevDelArchivedRevisionItem to use the
IConnectionProvider::getPrimaryDatabase method instead of wfGetDB,
which is deprecated in MediaWiki 1.39. It also adds type hints and annotations for clearer codebase and better maintainability.
- Add typing to the getIdField and getId methods.
- Improve documentation for constructor and setBits method.
Change-Id: Ic914c7afe8bdf0731a1d4f68aeefdfe77b5503ae
Update cases where one of the IConnectionProvider methods is called
immediately.
This doesn't really change anything, but I hope it helps promote
getConnectionProvider() as the common way to do this.
Follow-up to 8604c384f6.
Change-Id: Id0e7d02bab0c570343c2b1f03c70b44ee39db112
This function is uber-deprecated, meaning even its replacement is
deprecated, We have already migrated in static functions and more.
In this batch, all calls have been migrated that there is already a call
to MediaWikiServices::getInstance() making the migration easier. Of
course in most cases, they should eventually turn into proper service
injection but this at least makes it clear what services should be
injected.
Also removing "category" group since we are removing all groups except a
handful from mw (see T263127 for more information).
Bug: T330641
Change-Id: I90cd35ee45a37eb6e6bf7a531cc8f75effbd0328
To deprecate ::modifyDisplayQuery() and unblock a lot of migrations to
SelectQueryBuilder.
Bug: T344971
Change-Id: Icb9265644bdbc0b30e2a419ae0103f0e78fe90bd
I fixed some edge cases in the script that migrates to SQB and it
managed to fix these now.
Bug: T344971
Change-Id: I00cc9a6660d9bd4c64c976121b2121ccd7aae1f0
wfGetDB() has been deprecated since 1.39 (or more?) and it's better to
inject LBF and call ::getReplicaDatabase() or ::getPrimaryDatabase()
which is not straightforward in classes but for static functions, there
is no way to inject the method so we can simply call
MediaWikiServices::getInstance()->getDBLoadBalancerFactory()
While I was here, I migrated one call to SelectQueryBuilder.
Bug: T330641
Change-Id: Idd2278cef647035dce05a2d461a620e145fe1167
This class is used heavily basically everywhere, moving it to Utils
wouldn't make much sense. Also with this change, we can move
StatusValue to MediaWiki\Status as well.
Bug: T321882
Depends-On: I5f89ecf27ce1471a74f31c6018806461781213c3
Change-Id: I04c1dcf5129df437589149f0f3e284974d7c98fa
Using a php parser written on top of ANTLR4, done semi-automatically.
I checked everything and made adjustments.
Bug: T311866
Change-Id: I6150c6909bce8f3dbd745a26380cc0af9d9c547f
Not use RevisionRecord constants for LogPage or File,
even the number are the same, the context should be the match
Change-Id: Icf50f48fa63144c5ac798e7453faf9cd0a1b706a
Not used anywhere else as a method. It really is just a constant.
This goes along with Icf50f48. Can be merged in any order.
Change-Id: I8270df212193c10ad35e0b735cca67b2307e535e
This follows up change I608566700c, which was mainly generated by a
script. Most of the clean up here is fixing cases where it seems the
script for some reason collapsed multi-line arrays into single-line ones
and/or removed spaces after commas. A handful of other improvements are
included too (split merged conditions into ->where()->andWhere(), use
buildComparison()). In RevDelArchiveItem, a comment is restored that I
assume was removed accidentally (perhaps because the script didn’t
expect comments inside the conditions).
Bug: T330640
Change-Id: If27bafb12fdaa05d3dc1ae6da820e1630ae2742e
Follows-Up: I608566700c6d737ee986bf47dda87effc69614d6
I did this using a script written on top of antlr4 parser so it doesn't
have some clean ups a human would do but it's pretty nice already.
Bug: T330640
Change-Id: I608566700c6d737ee986bf47dda87effc69614d6
There is no way to express that Title::castFromPageIdentity(),
Title::castFromPageReference() and Title::castFromLinkTarget()
can only return null when the parameter is null. We need to add
Phan suppressions or explicit types almost everywhere that these
methods are used with parameters that are known to not be null.
Instead, introduce new methods Title::newFromPageIdentity() and
Title::newFromPageReference() (Title::newFromLinkTarget() already
exists), without the null-coalescing behavior, and use them when
the parameter is not null. This lets static analysis tools, and
humans, easily understand where nulls can't appear.
Do the same with the corresponding TitleFactory methods.
Change the obvious uses of castFrom*() to newFrom*() (if there is
a Phan suppression, a type check, or a method call on the result).
Change-Id: Ida4da75953cf3bca372a40dc88022443109ca0cb
* Inappropriate @inheritDoc usage. Arguably all @inheritDoc is
inappropriate but these are the ones PHPStorm flags as misleading
due to the method not being inherited.
* Doc comment type does not match actual argument/return type.
* I replaced "@return void|never" with "@return void" since never means
never, it doesn't make sense for it to be conditional. If a method
can return (even if that is unlikely) then @return contains the type
that it returns. "@return never" means that there is no such type
because the method never returns.
* Incomplete/partial/broken doc tags
Change-Id: Ide86bd6d2b44387f37d234c2b059d6fbc42ec962
Avoid code duplication and
allows to use the new styling if Icfb46d9 (T327538) gets merged
Remove duplication of span.history-deleted on Special:EditTags - before
this change a span.history-deleted element was nested inside another
span.history-deleted element and after this change it is not.
Change-Id: I2e27bd8e0bcca47a7734fcb6ee28c0d1e6bb5896
These exceptions are not documented with @throws and they're really not
meant to be caught.
Bug: T86704
Change-Id: I07f32e42c6fd4bc8785bac91547858f15a9fc2a8
so that extensions (i.e. CheckUser) can implement their own comment
store without having a lot of code duplication
basically the comment store version of I3a6486532f2ef36
Bug: T233004
Change-Id: Ib40f99e00a514d41776ce521baf113e46d37e9cd