This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItem and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Id2a582b624f21867240def2541c98ce5b1bd12b4
This patch introduces a namespace declaration for the
MediaWiki\RCFeed to RCFeed and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I2e63e05901a75d8cf8a1e9d874dc916c0a5749a4
This patch introduces a namespace declaration for the
MediaWiki\Json to FormatJson and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I5e1311e4eb7a878a7db319b725ae262f40671c32
Motivation:
* Remove need to hardcode out-of-component files in various places.
Especially for Gerrit queries, this not only reduces effort but
also makes these files more likely to show up in the first place.
* Clarify component boundaries and ownership, e.g. when filing tasks
with a stack trace.
* Now rather than later, to avoid need for multiple class renames and
aliases when PSR-4 namespaces are applied later (T166010).
Background:
Similar to how jobs in extensions belong to that extension, the same
is true within core. There is a distinction between the JobQueue system,
and individual jobs belonging to a specific feature or component,
likewise for deferred updates, and special pages.
To make a begin with this, I propose moving the job classes to their
respective components for cases where component boundaries are already
clear. E.g. due to exclusively being queued by that same component,
being named/introduced by the same commit, being already documented
as such in component descriptions on mediawiki.org.
Bug: T364652
Change-Id: I73d6b97c6ca9f5abd29f4277d0f845426aa23bd0
This patch introduces a namespace declaration for the
MediaWiki\Debug to DeprecationHelper and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I808c6aa7836445feaa7b401624d79d01f2c70322
This is using SelectQueryBuilder::queryInfo to interact with legacy code
In the long term this needs refactor to get a SelectQueryBuilder from
the class instead of a query info array.
Bug: T344971
Depends-On: I5dff80a2819bba4e923654ef31816a54269354b3
Change-Id: Ibf44e7de30e71fe8dd6447f77dfd0bf726be0a9b
Per the recentchanges table documentation, rc_new should be replaced with rc_source, which replaced rc_type.
Bug: T36320
Change-Id: Ie89e29b2363f36fe6080816c65d96394f6817fd9
Some of these have been marked in-code as deprecated for a long while,
but haven't ever been announced in the RELEASE-NOTES (and later,
HISTORY) file, so let's mark them up now so we can get the ball rolling
at least.
Per Gergo, the AuthManager one was 'born deprecated' and should only
have been used by humans also reading the deprecation notice given in
the code, and indeed no uses are known to code search, so also emit
deprecation warnings there immediately; others will have to wait until
uses have been migrated.
Change-Id: I0c1c71d8f4293623039302da35d58d2a24367e97
This will allow us to style NewPages consistent with other Minerva
special pages.
Update getStartBody and getEndBody to be consistent with ContribsPager,
now that the output of the UL is output by mGroupByDate
Bug: T360843
Change-Id: I3424d8f4f7a40ff60827065e83532315ba35dfd3
Check the affected rows count to detect a patrol conflict, which is
when the database query succeeds, but it was a no-op because another
request (possibly from the same user, or someone else) marked it as
patrolled already.
We detect it using the `rc_patrolled` condition because without it,
affectedRows() would always return 1, as the previous update condition
could match either the patrolled or patrolled version of the row.
Bug: T196182
Change-Id: I2aa4f2f752a40657883e0a6714dbb175c9d2fdcb
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
When OldChangesList is used, the mw-changeslist-line-inner that the
mw-changeslist-links is nested in is a span.
mw-changeslist-links is formatted as inline-block in skinStyles.less as
it is.
Bug: T275230
Change-Id: If97aa95472a73fce1f73c65dfcad961d24cf7e37
Found via (?<!IDBAccessObject)::READ_
We are planning to deprecate and remove implementing IDBAccessObject
interface just to use the constants.
Bug: T354194
Change-Id: I89d442fa493b8e5332ce118e5bf13f13b8dd3477
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
Merged duplicate branches in the switch statement related to the
RecentChange::SRC_NEW case, combining them with existing cases
for RecentChange::SRC_EDIT and RecentChange::SRC_CATEGORIZE.
Change-Id: If09288dcfdf40b4cf095a568eacac3621956e063
This makes the code easier to read to avoid jumps and improves
encapsulation by not allowing the rest of the class having access to the
logic. Of course, if needed then some code can be refactored out again
but for now let's not do YAGNI.
Change-Id: Ic37524e386fc04fd67e33768417ff8425f85b0ca
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
They're under 'specials' because that's where they're mostly used,
but they're just another kind of Pager (shown by their use outwith
the MediaWiki\Specials hierarchy, which is a bad code smell for us
to review later).
Bug: T166010
Change-Id: Iad3f91582b723c1e6679525aa852ffdfd8c6d5ba
The base phan config uses a file_exists check to determine whether to
use the namespaced class name, but it doesn't work when running against
core because MW_INSTALL_PATH isn't set. So specify the type in the local
config, and remove @phan-var annotations added in I6bbdbbe6.
Also use `::class` instead of string literals for classes.
Change-Id: I994a0ed32ea948253ed07ee3cc8868a0eaa6d8b9
empty() only makes sense when the expression it checks is possibly
undefined, otherwise it's equivalent to a truthiness check with the
additional downside of suppressing errors when it's not wanted.
Replace it with simple truthiness checks, using strict comparison when
that seems to help with polymorphic variables.
These were caught by a bespoke phan plugin.
Change-Id: I52999e5286a0d9ad70b0da40b41b9f998ecb990e
The design principle for SelectQueryBuilder was to make the chained
builder calls look as much like SQL as possible, so that developers
could leverage their knowledge of SQL to understand what the query
builder is doing.
That's why SelectQueryBuilder::select() takes a list of fields, and by
the same principle, it makes sense for UpdateQueryBuilder::update() to
take a table. However with "insert" and "delete", the SQL designers
chose to add prepositions "into" and "from", and I think it makes sense
to follow that here.
In terms of natural language, we update a table, but we don't delete a
table, or insert a table. We delete rows from a table, or insert rows
into a table. The table is not the object of the verb.
So, add insertInto() as an alias for insert(), and add deleteFrom() as
an alias for delete(). Use the new methods in MW core callers where
PHPStorm knows the type.
Change-Id: Idb327a54a57a0fb2288ea067472c1e9727016000
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