Commit graph

394 commits

Author SHA1 Message Date
DannyS712
71b64e46e4 ChangesList::insertRollback - remove internal use of Revision objects
Bug: T246284
Change-Id: I0f506e73eee994c1dd8610803f8ce1c53164ca59
2020-04-27 22:10:25 +00:00
Tim Starling
0b7295a5cd Hook interface doc comment followup
Mostly just narrower array types. A handful of other errors fixed.

Change-Id: Ied79d9e389867911bf83696dbb47f43305f8be7b
2020-04-21 09:12:23 +10:00
apaskulin
c44488f725 docs: Hook interface doc comment review
Edited doc comments for hook interfaces to improve
consistency and add type hints.

Bug: T246855
Change-Id: I38fa802463cd6f39bf5946dbbeb1b3ebaea604b2
2020-04-21 09:10:08 +10:00
Tim Starling
f5aaf75ad1 Automatically generated hook interfaces
Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.

Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:

* The source root, maintenance and tests, which use includes/Hook. Test
  hooks need to be autoloadable in a non-test request so that
  implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
  the parent ../Hook:
    * includes/filerepo/file
    * includes/search/searchwidgets
    * includes/specials/forms
    * includes/specials/helpers
    * includes/specials/pagers

Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.

Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
2020-04-20 13:31:05 +10:00
DannyS712
af7f397ccc Pass RevisionRecord to Linker methods
Hard deprecation of passing Revision objects will follow soon,
but until that is ready core calls can be updated

There is some code cleanup that could be done around the calls, but
to simplify review no other changes are made.

Bug: T249561
Change-Id: Ifcfb3811650decffeaa87dc033c41fd1710b47a6
2020-04-18 01:24:54 +00:00
DannyS712
9e561b4e65 Use RevisionRecord in ChangesList::revDateLink
The change to ChangesList::revDateLink is not backwards compatible,
because the method was marked as @internal

Due to a breaking change in HistoryPager::revLink, and the fact that
it didn't have a visibility defined, it has been made private

Bug: T246284
Change-Id: I2f1309fda1c312a6cf634de48ad0bbcfcb2d83ae
2020-04-04 00:49:28 +00:00
jenkins-bot
0de13c6125 Merge "Fix mismatching type hints in PHPDoc tags" 2020-03-26 13:35:31 +00:00
Petr Pchelko
a2cf98ef70 Remove usages and hard deprecate Revision::newFromRow
Also updates CategoryMembershipChange to accept a RevisionRecord
instead of a Revision.

Bug: T246284
Change-Id: I30024b7278e108b0f4e20ef1eb44647916fad47c
2020-03-25 11:42:36 -07:00
Thiemo Kreuz
1006aa41e6 Fix mismatching type hints in PHPDoc tags
This is a collection of random bits from my local stashes. This patch
intentionally only touches comments, no code.

Notably:
* Use more specific string[] instead of array, if possible.
* Some comments mention "or null", but miss to list the type.

Change-Id: I712b28964f125c8e3dcb4e3fb993757a09f96644
2020-03-24 09:59:02 +01:00
Thiemo Kreuz
7a4df9b019 Remove auto-generated and empty lines in comments
… and add the missing newline after the initial <?php.

Change-Id: I83bbbb1504e4b2bd97eec63c7626d34c655c3197
2020-03-17 09:55:24 +01:00
DannyS712
78bc3ae255 Hard deprecate Revision::userCan
Replace remaining uses outside of tests, hide deprecated in tests

Bug: T247259
Change-Id: I91dfb46ed6864ee89d968aea8ec93b5ea2f8389e
2020-03-11 02:10:52 +00:00
Abbe98
0da37edd0b EnhancedChangesList: add screen reader support to live changes
Expose EnhancedChangesList content to assistive technology as it's updated.

Change-Id: I5b9744075bf7ab03388ed7f827a171b6c253de8d
2020-03-10 21:17:57 +00:00
DannyS712
7186b63f82 Hard deprecate Title::getUserPermissionsErrors
Remove final uses as well

Bug: T244929
Change-Id: I65e937c7b9904b1e93f649508b14148849589f82
2020-02-26 05:09:55 +00:00
DannyS712
dec8ddddcf Hard deprecate RecentChange::markPatrolled
It uses $wgUser, but rather than adding a user parameter, the whole
method can just be deprecated and removed. All existing calls have
already been updated.

Bug: T245195
Change-Id: Id7d67cd69d87283cb88455593a4a183c4a5c7721
2020-02-26 04:19:55 +00:00
Timo Tijhof
f575721a06 Update all use of $wgVersion to MW_VERSION
Follows-up I04628de4152dd5.

Bug: T212738
Change-Id: I718474ec0d9fd29ac2c05477f0f2493615d8aff5
2020-02-25 02:16:12 +00:00
James D. Forrester
0958a0bce4 Coding style: Auto-fix MediaWiki.Usage.IsNull.IsNull
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
2020-01-10 14:17:13 -08:00
jenkins-bot
cf92c2dc44 Merge "Use namespaced IPUtils class" 2020-01-01 23:56:22 +00:00
Kunal Mehta
99007e96c7 Use namespaced IPUtils class
Change-Id: I047e099a93203a59093946d336a143d899d0271f
2020-01-01 02:36:49 -08:00
Daimona Eaytoy
dbf0990447 Avoid PHP scalar type juggling in includes/ (part 2)
Continuation of e5444ea55a.

Change-Id: I9f95e7de4e219dee3abcdd210bb708d949f378d0
2019-12-30 20:57:18 +00:00
Thiemo Kreuz
b39a56d74e Make use of existing array value variables in foreach loops
In all these cases, the foreach() loop specifies a variable for the
current value. We don't need two ways to access the same value. This
makes the code harder to read.

Change-Id: I6ed7a518439963b7091057194de993a7e977be32
2019-12-29 12:04:29 +00:00
Daimona Eaytoy
598c4d7fcb build: Upgrade phan to 0.9.0
Scalar casts are still allowed (for now), because there's a huge amount
of false positives. Ditto for invalid array offsets.

Thoughts about the rest: luckily, many false positives with array offsets
have gone. Moreover, since *Internal issues are suppressed in the base
config, we can remove inline suppressions.

Unfortunately, there are a couple of new issues about array additions
with only false positives, because apparently they don't take
branches into account.

Change-Id: I5a3913c6e762f77bfdae55051a395fae95d1f841
2019-12-07 20:16:19 +00:00
jenkins-bot
2b04ef6657 Merge "Set method visibility for various constructors" 2019-12-05 10:23:34 +00:00
Umherirrender
0688dd7c6d Set method visibility for various constructors
Change-Id: Id3c88257e866923b06e878ccdeddded7f08f2c98
2019-12-03 20:17:30 +01:00
Thiemo Kreuz
78ca9eff4a Remove duplicate variable name from class property PHPDocs
Repeating the variable name doesn't do anything. Documentation
generators don't need it. It's more stuff to read that doesn't add new
information. And it can become outdated.

Note there are two types of @var docs. When used inline (and not on a
class property) the variable name is needed.

Change-Id: If5a520405efacd8cefd90b878c999b842b91ac61
2019-12-02 12:58:29 +00:00
jdlrobson
5128caa3e5 Remove extraneous semicolons in unintended places and DOCUMENT!
The contributions and history page was showing some semicolons in unexpected places.
These unwanted semicolons are now supressed by reverting to a new standalone element
in exactly the same place as the previous semicolon. This avoids the issue of
ordering that we hit before.

I have documented the behaviour of the semicolon separator in contribpager pages
My seemingly harmless change in Ic4508788299a13c4c830f447141d17d99ebe002e

For future generations I have encapsulated what I've learned in extensive
comments which seem important given the information I have acquired while
working on this patch.

Bug: T233649
Change-Id: I9723ead1815685a9cbcccf2c4e2f3ffff36dcee3
2019-11-12 09:24:47 -08:00
jdlrobson
30c98e2351 Semicolon separator for article title and timestamp is a pseudo element
This helps us avoid a stray semicolon in mobile mode.

Bug: T233649
Change-Id: Ic4508788299a13c4c830f447141d17d99ebe002e
2019-11-04 13:49:21 -08:00
Max Semenik
8a98dd9d59 Convert some private static arrays to constants
Remove @since for some private ones as we don't guarantee anything
about private class members.

Change-Id: Ifb898353c02082e9ef69d67f69339345c6cd154d
2019-10-16 01:30:54 +00:00
Daimona Eaytoy
e3412efac3 Unsuppress PhanParamReqAfterOpt, use PHP71 nullable types
These were all checked with codesearch to ensure nothing is overriding
these methods.
For the most part, I've updated the signature to use nullable types; for
two Pager's, I've just made all parameters non-optional, because you're
already forced to pass them with a required parameter at the end.

Bug: T231636
Change-Id: Ie047891f55fcd322039194cfa9a8549e4f1f6f14
2019-10-10 11:53:58 +02:00
jenkins-bot
05ce3b7740 Merge "Title: make newFromText, isValid, and canExist behave consistently." 2019-10-08 13:54:57 +00:00
daniel
9171cbe4ca Title: make newFromText, isValid, and canExist behave consistently.
This patch fixes the documentation of newFromText and makeTitleSafe to
no longer state incorrectly that any Title they return is guaranteed to
be valid. That has never been true.

It also makes canExist() checks a lot stricter, to match the assumptions
of current callers, namely that the title can exist as a wiki page.

Finally, it replaces several existing calls to isValid() with calls to
canExist().

Bug: T229705
Change-Id: I2a483136ec6acca49afb5eb32cb94616672b8fb2
2019-10-08 11:16:11 +02:00
Volker E
203f7aba8c Mark consistently with any edit summaries
Marking with `.comment` to be consistent with `Linker:commentBlock`.

Change-Id: Idba91bd3d1345aa18da6745ad86f1bac2628dae7
2019-09-19 18:06:48 -07:00
jenkins-bot
60882bb6b0 Merge "Log entries can be rendered with parentheses in HTML" 2019-09-20 00:22:16 +00:00
jdlrobson
432cc11fae Log entries can be rendered with parentheses in HTML
Entries such as "User creation log" on Special:RecentChanges can
be wrapped or not wrapped in parentheses

Bug: T219348
Change-Id: Ic764081497dbe8d6d9e5bff6f8a1ceeac4b306e2
2019-09-19 03:58:51 +00:00
Umherirrender
f74400487f phan: Disable enable_class_alias_support
It is enabled for b/c in extensions, but not needed in core

Change-Id: I51dca12be9c77049f77563d9bf0edd07928c2300
2019-09-15 08:26:52 +00:00
jenkins-bot
0705929343 Merge "Remove dead code from RCCacheEntryFactory" 2019-09-14 13:12:52 +00:00
jenkins-bot
f15d6aaa97 Merge "Remove usages of Title::get{Previous,Next}RevisionId" 2019-09-13 22:58:36 +00:00
Petr Pchelko
56c21d059c Remove usages of Title::get{Previous,Next}RevisionId
The methods were deprecated since 1.34.

Change-Id: Ib95ac1ba36a8ffd6b71ed67642d8abb2e3538bae
2019-09-13 09:49:13 -07:00
Matěj Suchánek
bfd32fc842 Remove dead code from RCCacheEntryFactory
Change-Id: I7832bac1e9c700e4a2a37b765d257ce8a7ace458
2019-09-13 11:51:52 +02:00
Daimona Eaytoy
a4327ec8c8 changes: Fix wrong typehint
Fortunately the method is private.

Change-Id: Ic3838f1269c99b9679c7552bcb7b049f0b8e7b6f
2019-09-12 10:57:34 +00:00
Brad Jorsch
c29909e59f Mostly drop old pre-actor user schemas
This removes most of the pre-actor user and user_text columns, and the
$wgActorTableSchemaMigrationStage setting that used to determine
whether the columns were used.

rev_user and rev_user_text remain in the code, as on Wikimedia wikis the
revision table is too large to alter at this time. A future change will
combine that with the removal of rev_comment, rev_content_model, and
rev_content_format (and the addition of rev_comment_id and rev_actor).

ActorMigration's constructor continues to take a $stage parameter, and
continues to have the logic for handling it, for the benefit of
extensions that might need their own migration process. Code using
ActorMigration for accessing the core fields should be updated to use
the new actor fields directly. That will be done for in a followup.

Bug: T188327
Change-Id: Id35544b879af1cd708f3efd303fce8d9a1b9eb02
2019-09-09 11:38:36 -04:00
Daimona Eaytoy
b5cbb5ab3f Upgrade phan config to 0.7.1
This allows us to remove many suppressions for phan false positives.

Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
2019-09-04 08:20:53 +00:00
Daimona Eaytoy
c659bc6308 Unsuppress another phan issue (part 7)
Bug: T231636
Depends-On: I2cd24e73726394e3200a570c45d5e86b6849bfa9
Depends-On: I4fa3e6aad872434ca397325ed7a83f94973661d0
Change-Id: Ie6233561de78457cae5e4e44e220feec2d1272d8
2019-09-03 17:19:21 +00:00
Daimona Eaytoy
327e8ea416 Unsuppress phan issues part 6
Bug: T231636
Depends-On: I50377746f01749b058c39fd8229f9d566224cc43
Change-Id: I2cd24e73726394e3200a570c45d5e86b6849bfa9
2019-09-01 09:48:45 +00:00
Daimona Eaytoy
e2e543f7c2 Unsuppress more phan issues (part 5)
Bug: T231636
Depends-On: I6e5fba7bd273219b1206559420b5bdb78734aa84
Change-Id: I50377746f01749b058c39fd8229f9d566224cc43
2019-09-01 09:48:31 +00:00
Daimona Eaytoy
e70b5b3309 Unsuppress other phan issues (part 4)
Bug: T231636
Depends-On: I58e67c2b38389df874438deada4239510d21654f
Change-Id: I6e5fba7bd273219b1206559420b5bdb78734aa84
2019-08-31 17:13:39 +00:00
Petr Pchelko
f1914810a7 Remove usages of Title::quickUserCan
Change-Id: Ifa53e0ec800e23dc4184d133a100fb9378dfee9e
2019-08-29 11:48:30 -07:00
Daimona Eaytoy
f18af0b61f Remove more Oracle and Mssql leftovers
Follows-up 4d10bb14e8 and 807d793ab9.

According to codesearch [0], these were the last usages. Note that this
patch leaves two constants in places, IDatabase::DBO_SYSDBA and
DBO_DDLMODE. These are public constants used "mostly for oracle" according
to the docs, but maybe we could find other use cases in the future (?).

[0] - https://codesearch.wmflabs.org/core/?q=oracle%7Cmssql&i=fosho&files=%5C.%5B%5Ej%5Cd%5D%7Cen%5C.json&repos=

Bug: T230418
Change-Id: Ibfb748b4b23b885a77f4de161af4bf2ab9649a89
2019-08-25 17:21:49 +00:00
jenkins-bot
36fdf484e9 Merge "Replace User::isAllowed with PermissionManager." 2019-08-21 08:00:33 +00:00
Petr Pchelko
1d286560d2 Replace User::isAllowed with PermissionManager.
Covers root includes, actions, api, block, changes,
changetags, diff and PermissionManager itself.

Bug: T220191
Change-Id: Ic027d32f5dd8f4c74865df0c8a9fcf91123c889c
2019-08-20 14:43:51 -07:00
Stephane Bisson
04f0b682a5 RCFilters: add namespace filters for all contents and all discussions
These filters provide a shortcut to see or highlight all entries associated
with a subject or a talk namespace.

They are defined as real filters on the client-side and are superset
of all other namespace filters.

They are expanded to the list of namespaces they represent on the server-side.

Bug: T201520
Change-Id: Id9e04a38c2d7c8165c27af98959aa5715225faa8
2019-08-15 13:57:02 -04:00