Commit graph

21 commits

Author SHA1 Message Date
Umherirrender
e662614f95 Use explicit nullable type on parameter arguments
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
2024-10-16 20:58:33 +02:00
James D. Forrester
bc662aec9b Move Language and friends into Language namespace
Bug: T353458
Change-Id: Id3202c0c4f4a2043bf97b7caee081acab684155c
2024-08-10 13:36:30 +02:00
Derick Alangi
6635d45564
CommentStore: hash() has only one caller, make private
This method seems to have only a single caller which happens to be
in the CommentStore.php class itself. Maybe we should just make this
a private utility.

Test plan
=========

If this patch fails, then I'm probably wrong and something else is
using it otherwise, then we can make it private.

Change-Id: Ib774af48ddf7e0a42a1c9a08cdecd5317e238cb4
2024-07-25 00:30:35 +02:00
Ebrahim Byagowi
a717db8e60 Add namespace and deprecation alias to FormatJson
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
2024-05-16 16:28:01 +03:30
James D. Forrester
8e940c4f21 Standardise all our class alias deprecation comments for ease of grepping
Change-Id: I7f85d931d3b79da23e87b4e5692b2e14be8fcaa0
2024-03-19 20:11:29 +00:00
James D. Forrester
eeb5a740b3 Namespace Message, move to appropriate directory
Bug: T353458
Change-Id: I088cbc53fbcdb974e5b05b45a62e91709dacc024
2024-02-14 15:10:36 -05:00
Alexander Vorwerk
2a1a995177 CommentStore: Remove unused getFields method
not at all needed

Bug: T343558
Change-Id: Ibd49f8e0cb078376b4e19757c4ca864457a40911
2024-01-20 16:21:39 +01:00
Daimona Eaytoy
ebb742d04f Add second batch of taint-check annotations
Based on taint-check's MediaWikiSecurityCheckPlugin.php.

Bug: T321806
Change-Id: I1c86215afb531de03eae0c583de6b2866e50f9eb
2023-09-23 18:18:17 +02:00
Amir Sarabadani
ec1acd8df4 filerepo: Switch to use IConnectionProvider where possible
It uses db factory in some places and that should be properly cleaned up

Bug: T330641
Change-Id: I310199ce7b2e46d08392204d26e77690dc6afd20
2023-09-12 00:08:38 +00:00
Tim Starling
95bd40b25c In query builders, use insertInto() and deleteFrom() instead of insert() and delete()
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
2023-09-08 10:16:08 +10:00
Alexander Vorwerk
4a4d9e2621 Merge CommentStoreBase into CommentStore
Bug: T343558
Change-Id: I74cd68b7689f750d9300141575506910878f1802
2023-09-01 12:17:14 +02:00
James D. Forrester
84157df23b Follow-up f6bd18d: Add in-code comment on aliases for when they were added
Change-Id: I16cd2aba7b353b52359604d0290f9996e6bc0044
2023-08-25 20:54:34 +00:00
Alexander Vorwerk
178adb3e2b CommentStore: Drop temp table code
Bug: T215466
Change-Id: If0a142cd0b68fdd58a49a106240bd997e7361227
2023-06-13 23:30:58 +00:00
Alexander Vorwerk
27beeac288 Drop $wgCommentTempTableSchemaMigrationStage
This was a temporary flag to allow setting the migration stage for a
comment migration with a temp table.

Since the rev_comment_id migration is done, this is no longer needed.

Dropping the compatibility code for temp tables will be done in
follow-ups.

Bug: T299954
Change-Id: I290a74f27b05cd7e062dda78766911ffe3053d08
2023-06-09 11:32:16 +00:00
Alexander Vorwerk
b3611755d7 Drop revision_comment_temp
Bug: T299954
Change-Id: I85d21b1eff70a7d70e8ce14f25d66f7e7c76e5fe
2023-06-07 15:34:57 +00:00
Alexander Vorwerk
ef8d45fd12 Migrate revision_comment_temp to rev_comment_id
Bug: T299954
Change-Id: If3224c73645d5ce5542228a6cee2848e98a9efee
2023-05-27 21:59:26 +00:00
Umherirrender
2e020a25f0 Remove deprecated CommentStore::getStore
Bug: T325475
Change-Id: I0ff5e286cd15f45515e75fa85db529758e8f5ed9
2023-04-22 21:25:35 +02:00
jenkins-bot
ef3d8932fc Merge "Hard-deprecate CommentStore::getStore" 2023-01-14 02:37:17 +00:00
Umherirrender
1879408eb6 Hard-deprecate CommentStore::getStore
Bug: T325475
Change-Id: Iaea7466f0614966981c83f321544e0fda2814b8b
2023-01-09 18:01:56 +01:00
Alexander Vorwerk
cf12721101 Prepare migration from revision_comment_temp to rev_comment_id
This patch introduces a configuration variable that allows one
to control the migration stage in production.

Bug: T299954
Change-Id: I36f1e3cd9fb0f25fd43f4dbb97f791da5eb1147b
2023-01-02 22:33:16 +01:00
Alexander Vorwerk
f6bd18d6c2 Split a base class out of CommentStore
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
2023-01-01 22:34:36 +00:00