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 touches various production classes and maintenance scripts.
The code should do the exact same as before. The main benefit is that
the syntax avoids any repetition.
Change-Id: I5c552125469f4d7fb5b0fe494d198951b05eb35f
This is more convenient for callers since they can avoid the pattern
of setting $fname to __METHOD__ and needing $fname in the "use" clause.
This is also more consistent with AutoCommitUpdate/AtomicSectionUpdate.
Remove @since tags from @internal MWCallableUpdate class.
Change-Id: I67c58897dc366a55f43e0a61d56064b26d520c17
Many unit tests needs adjust, because the ->with() call no longer
matched and using expression objects for the matching repeats the same
code between test and real implementation.
Bug: T361023
Change-Id: I6f8dbd12d7135ee28ad5b1eabb58d1354d1591d3
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
Why:
- A few places in core should check the isKnown
flag (I4ce534a847461230f7fa276a565bdc1d6c9857e1) rather than isEnabled
What:
- Update ChangesListSpecialPage, UserGroupManager,
UserSelectQueryBuilder, WatchedItemQueryService,
ApiQuerySiteInfo, maintenance/expireTemporaryAccounts and
maintenance/userOptions to used the isKnown() config check
Bug: T356524
Change-Id: I5a88808c7297752c60f6e7ffe16cf6543d783269
This adds MediaWiki\Watchlist namespace to the classes of watchlist
directory and adds deprecation notice since 1.43 to the just created
unnamespaced aliases of the classes.
Bug: T353458
Change-Id: I4234f8fe62bb3bde6f5271c7ba31a2420b0f4b90
This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItemStore and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I820a3512440ba5a1de13e8470ccf5845918f3198
This patch introduces a namespace declaration for the
Wikimedia\Watchlist to ActivityUpdateJob and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I34342bb01c8f6c9657f1b2f05de1de64a107665f
This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItemQueryServiceExtension and
establishes a class alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: I65b414013291b0ca21288b70e29530bba3f7e22e
This patch introduces a namespace declaration for the
MediaWiki\Watchlist to WatchedItemQueryService and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Ib1b5c19c89087940987730939e84c8cd35cd3760
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\Watchlist to WatchlistExpiryJob and establishes a class
alias marked as deprecated since version 1.43.
Bug: T353458
Change-Id: Ia0a85c9d7550edc972ea512606dfcf272c71a6cd
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
A recent core patch removed `editmywatchlist` user right from
anonymous users, as those users do not have watchlist access.
It turns out WatchlistManager is also responsible for informing
TalkPageNotificationManager when should talk page notifications
be cleared.
Unlike watchlist, all users have talk page notifications,
including logged out users. Consequently, WatchlistManager
needs to inform TalkPageNotificationManager before checking
for the `editmywatchlist` permission.
Ideally, this would not be a part of WatchlistManager
at all, and callers would invoke TalkPageNotificationManager
as appropriate (or a wrapper service is introduced), but
that change is likely to trigger similar regressions, as there
can be funny & interesting callpaths.
In the interest of patch scope, ignore permission checks
for this one matter in WatchlistManager for now.
Follow-up to I1ccda3878a658d4251429ae65ebee04c09d81243.
Bug: T345031
Change-Id: Id88fd9c5e05cd7337b4cfc1abebe61a36c39f0d4
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
The db/ directory does not have an owner and it's a mess in general.
These classes don't depend on anything in core except the rdbms library.
Let's simply move it there. In other words, Krinkle made me do it.
Since the class was moved in I6202e52ba73 merged less than a week ago,
no need to alias anything.
Bug: T321882
Change-Id: I24ceeb8bf765a50f441270136acd612359d50aa2
They are not suitable to go to rdbms library as they depend on mediawiki
pieces, the second best place is the db/ directory.
Bug: T321882
Change-Id: I6202e52ba7306d74261206c2ba7930c5f1a0a18e
* Illegal string offset and invalid argument supplied to foreach, due to incorrect type information
* Array internal pointer reset is unnecessary
* $hookData unused since MW 1.35 due to incomplete revert
* array_push() with single element
* Unnecessary sprintf()
* for loop can be replaced with str_repeat()
* preg_replace() can be replaced with rtrim()
* array_values() call is redundant
* Unnecessary cast to string
* Unnecessary ternary. Often the result relies on short-circuit evaluation, but I find it more readable nonetheless.
Change-Id: I4c45bdb59b51b243fa96286bec8b58deb097d707
Follows-up I9bfa502a0b (9b8f153f). Also document the reason for
this logic, to the best of my knowledge, and some ideas to improve
it.
Bug: T305093
Change-Id: I4c5bf4d4da83ff1e03d0fe0dd9891507b1f1e455
It is not possible to set $wgUseEnotif on LocalSettings.php,
because it is always set on setup, it should not be a global/setting.
Just remove it from the dynamic setup and use the config it is set from
Bug: T305093
Change-Id: I9bfa502a0b9798bd149b4cfe4db86a0461e76f55
Now largely automated:
VARS=$(grep -o "'[A-Za-z0-9_]*'" includes/MainConfigNames.php | \
tr "\n" '|' | sed "s/|$/\n/;s/'//g")
sed -i -E "s/'($VARS)'/MainConfigNames::\1/g" \
$(grep -ERIl "'($VARS)'" includes/)
Then git add -p with lots of error-prone manual checking. Then
semi-manually add all the necessary "use" lines:
vim $(grep -L 'use MediaWiki\\MainConfigNames;' \
$(git diff --cached --name-only --diff-filter=M HEAD^))
I didn't bother fixing lines that were over 100 characters unless they
were over 120 and triggered phpcs.
Bug: T305805
Change-Id: I74e0ab511abecb276717ad4276a124760a268147
This eliminates a query from getRevisionById(), and in combination with
the parent commit Ibf0ab45ddfebbf6f188d3630610946c3c7376f9f, also
eliminates the query from getTimestampFromId().
Change-Id: I87d9b5a84caad7363230e99232bb74c9290476b0
Deferring newtalk updates caused the skin to show the notification on
the same user talk page view request in which it is cleared. Even if the
user refreshed the page, it would still show the notification since a
304 response was given.
So, move the newtalk part of WatchlistManager
::clearTitleUserNotifications down to TalkPageNotificationManager, so
that the in-process updates can be done immediately, with the DB updates
being deferred. TalkPageNotificationManager is now responsible for
deferring the relevant parts.
Originally (2002) the newtalk status was set by calling
User::saveSettings(), which had the side-effect of updating
user_touched. Restore this behaviour, which is fast now due to the
"quick touched" cache. Also update the touched timestamp when the
notification is cleared.
Change-Id: Ic3c14bca7bed04f46afffa971fa0a57224c666ce
In addWatch and removeWatch, after checking permissions
we call the corresponding *IgnoringRights method and need
to provide a UserIdentity object. Previously, the Authority
used in addWatch/removeWatch was converted to a full User
object via the UserFactory, but since we only need to provide
a UserIdentity we can use Authority::getUser
Change-Id: I32d63dfa2ec4ce35ff6ba1be7c11d9c3d355aa7c
- take PageIdentity in addition to LinkTarget where appropriate and
deprecate taking LinkTarget
- take Authority in addition to UserIdentity where appropriate and
deprecate taking UserIdentity
Change-Id: I410a4c26b25e086e1e6abb293789d718de4aa20a