Commit graph

60482 commits

Author SHA1 Message Date
Tim Starling
d459add63d Introduce wfDeprecatedMsg()
Deprecating something means to say something nasty about it, or to draw
its character into question. For example, "this function is lazy and good
for nothing". Deprecatory remarks by a developer are generally taken as a
warning that violence will soon be done against the function in question.
Other developers are thus warned to avoid associating with the deprecated
function.

However, since wfDeprecated() was introduced, it has become obvious that
the targets of deprecation are not limited to functions. Developers can
deprecate literally anything: a parameter, a return value, a file
format, Mondays, the concept of being, etc. wfDeprecated() requires
every deprecatory statement to begin with "use of", leading to some
awkward sentences. For example, one might say: "Use of your mouth to
cough without it being covered by your arm is deprecated since 2020."

So, introduce wfDeprecatedMsg(), which allows deprecation messages to be
specified in plain text, with the caller description being optionally
appended. Migrate incorrect or gramatically awkward uses of wfDeprecated()
to wfDeprecatedMsg().

Change-Id: Ib3dd2fe37677d98425d0f3692db5c9e988943ae8
2020-06-22 14:34:39 +10:00
jenkins-bot
447cd98b8c Merge "Use MediaWikiServices::getAuthManager instead of AuthManager::singleton" 2020-06-22 01:22:19 +00:00
Umherirrender
fd666afbb0 Use MediaWikiServices::getAuthManager instead of AuthManager::singleton
Change-Id: I92c31b963095eab751df9f8c1715e8e23b7e8485
2020-06-22 00:57:08 +00:00
Umherirrender
bff29fc8f4 Remove false check from type hinted argument
Type hint includes null and string, not false

Change-Id: I4644255b7cf2e9db940eb2cdedee0f20df0cc130
2020-06-21 22:35:15 +02:00
DannyS712
733872afda wfLogProfilingData: Remove $request, created but never used
Change-Id: I5c6937c939c699681976e230124a00af10e2cbd0
2020-06-21 07:23:39 +00:00
jenkins-bot
daff5b8e5a Merge "API: Use MediaWikiServices::getAuthManager in various Api classes" 2020-06-20 23:23:07 +00:00
Umherirrender
3d45f17398 API: Use MediaWikiServices::getAuthManager in various Api classes
Change-Id: I0af2e5fe91097077eeaf83027494065a0c1a6c04
2020-06-20 23:04:17 +00:00
jenkins-bot
3bb48799e3 Merge "media: Remove truthy check on array in FormatMetadata" 2020-06-20 22:08:44 +00:00
jenkins-bot
fe89b9041a Merge "rdbms: Remove is_array check on typed argument in DatabasePostgres" 2020-06-20 21:15:48 +00:00
Umherirrender
4f45c8b2de media: Remove truthy check on array in FormatMetadata
Change-Id: Iafe3741e619437d9fb72c46882395983b4de27b0
2020-06-20 20:54:38 +00:00
Umherirrender
d5259a9449 rdbms: Remove is_array check on typed argument in DatabasePostgres
Change-Id: I0d5b79c1453c4600cb7351aefd1e07d7d2f59044
2020-06-20 20:52:01 +00:00
jenkins-bot
ba443c4a93 Merge "WebRequest: Rewrite language handling in getAcceptLang()" 2020-06-20 18:09:33 +00:00
Umherirrender
f6617ba4b7 WebRequest: Rewrite language handling in getAcceptLang()
Change-Id: Ifcf0bc4c416d9b0a61d6ae82a184ba53b4f36016
2020-06-20 17:48:27 +00:00
jenkins-bot
110d0cbd71 Merge "Remove is_scalar check on array" 2020-06-20 14:55:28 +00:00
jenkins-bot
f9056e3eca Merge "Remove null check on type hinted argument" 2020-06-20 14:53:06 +00:00
jenkins-bot
ad4a3ba45f Merge "skins: Allow skins to load script modules via Skin class options" 2020-06-19 21:14:24 +00:00
Umherirrender
8919239236 Remove is_scalar check on array
is_array is called before is_scalar and arrays are not scalar

Change-Id: I73e65ac8bce95e31a2c5da7a48a212ce35fb4f40
2020-06-19 19:23:17 +02:00
Umherirrender
2280d96cdc Remove null check on type hinted argument
Change-Id: I2d98662cc325a69b3a139df65d390d801684b4fd
2020-06-19 19:18:28 +02:00
jenkins-bot
7ba2e0aed3 Merge "Clarify that addModuleStyles is for style-only modules" 2020-06-19 16:33:17 +00:00
jenkins-bot
148615b891 Merge "Swap null and is_int check to get the expected warn message" 2020-06-19 15:59:13 +00:00
jenkins-bot
f5ac95db35 Merge "Fix combination of (int) and ??" 2020-06-19 15:59:06 +00:00
jenkins-bot
7c620e02dc Merge "Check for INF instead of false for message exif-maxaperturevalue-value" 2020-06-19 15:58:59 +00:00
Lucas Werkmeister
5ba809c214 Clarify that addModuleStyles is for style-only modules
“the styles of … ResourceLoader modules” suggests to me that this method
can be used with any ResourceLoader module(s), and their style parts
will be loaded as <link rel=stylesheet> while JavaScript parts will load
as usual, but this is not in fact the case: if ResourceLoaderClientHtml
encounters a module type other than LOAD_STYLES in the moduleStyles
modules, it logs an error and skips the module.

Change-Id: If0e709311c1b777f6d99cb714f19307c1015ec01
2020-06-19 17:29:48 +02:00
Umherirrender
17a5d5a84b Fix combination of (int) and ??
(int) has higher precedence as ?? and that means the array key is always
casted first and the error suppression part of ?? cannot work

https://www.php.net/manual/en/language.operators.precedence.php

Change-Id: Iee7dc9297c0745ce48295f637a7591ce9385aa4d
2020-06-19 17:28:22 +02:00
Umherirrender
abb1ccbb47 Swap null and is_int check to get the expected warn message
!is_int also true for null, so swap the conditions

Change-Id: I99c4c9e6f724430faf9b4e28ca98fe60f5a9d6aa
2020-06-19 17:25:03 +02:00
jenkins-bot
c82316a824 Merge "Remove falsy check after new call" 2020-06-19 09:08:37 +00:00
jenkins-bot
cbb680d6c2 Merge "Simplify use of ?? in MWLBFactory" 2020-06-19 09:07:06 +00:00
Umherirrender
47f422d59f Check for INF instead of false for message exif-maxaperturevalue-value
** cannot return false, but INF

Change-Id: Ib08a94720fb70b845753b6640e3c0ff5e6894322
2020-06-19 08:51:39 +00:00
jenkins-bot
6c8f3c6950 Merge "title: Don't query/create LinkCache service when not needed" 2020-06-18 23:24:16 +00:00
jenkins-bot
cc5d33ce68 Merge "Fix display of multiple licenses on Special:Version/License" 2020-06-18 23:04:34 +00:00
jenkins-bot
ac248391ef Merge "SpecialChangeContentModel: Always use POST method for both forms" 2020-06-18 21:00:12 +00:00
jdlrobson
ae9c1d32ac skins: Allow skins to load script modules via Skin class options
This option parallels the styles option. This reduces the need for skins
to extend getDefaultModules and groups skin scripts in a consistent
fashion.

Change-Id: Iaf12d575e691597dea398627f6d34cb425dbf9bb
2020-06-18 20:02:42 +00:00
Umherirrender
148e7e3940 Remove falsy check after new call
A new call can never return null or false

Change-Id: I792eb6c912828919c02bc5990f129d00accd0ab6
2020-06-18 19:41:01 +02:00
Umherirrender
4c216537df Simplify use of ?? in MWLBFactory
When the left side of ?? is wrapped with [] the array has always one
item and that means it is always true and then used

Move the use of the array key into the existing isset
The empty array for $serversCheck is the default

Change-Id: I2ec95026b3cd5a72dcaf540f369b140fd7b69a53
2020-06-18 17:17:37 +00:00
jenkins-bot
c6a3d5cc6a Merge "Remove unused Title::newFromText in Linker::formatLinksInComment" 2020-06-18 16:46:15 +00:00
jenkins-bot
836400235f Merge "parser: Remove return from callback for Sanitizer::removeHTMLtags" 2020-06-18 16:46:06 +00:00
jenkins-bot
9b2bb87930 Merge "Remove unneeded null check from WebRequest::normalizeUnicode" 2020-06-18 16:45:57 +00:00
jenkins-bot
31b338058d Merge "Remove falsy check after new call" 2020-06-18 16:21:06 +00:00
jenkins-bot
c089a7edaa Merge "UserFactory: Document that newFromName expects a validation constant" 2020-06-18 12:52:16 +00:00
Thiemo Kreuz
b1850a49a7 title: Don't query/create LinkCache service when not needed
It seems in the vast majority of cases (when $flags is 0 and
$this->mArticleID is already known) none of the conditions is true, and
this service is not needed. As this is a very basic, heavily used method
I feel it's worth avoiding unnecessary calls like this.

Change-Id: Ib668071ffe029f3318e110b9f791e400a2becc7a
2020-06-18 14:01:42 +02:00
jenkins-bot
bd4065ed9b Merge "WikiPage::doEditUpdates - accept a RevisionRecord object" 2020-06-18 01:24:33 +00:00
Reedy
69a9055556 Fix display of multiple licenses on Special:Version/License
Bug: T255736
Change-Id: I7a29f8c4dbb47a9b1be0ff5cdf7ebdb8e0a10339
2020-06-18 01:54:12 +01:00
Bartosz Dziewoński
7f0be4f03b Fix redirects using Special:MyLanguage etc. when using a mobile domain
'wgInternalRedirectTargetUrl' should be set using getLinkURL()
(which doesn't contain the domain) instead of getFullURL().
This is already the case for normal article redirects (see how
'wgInternalRedirectTargetUrl' is set in Article.php).

Bug: T255620
Change-Id: I77473bedd52bc51c8ef53d6bc695b6bf2ebd0bfd
2020-06-17 22:41:49 +00:00
Bartosz Dziewoński
f805387f62 SpecialChangeContentModel: Always use POST method for both forms
HTMLForm can't detect whether a GET form was submitted or just viewed,
resulting in error messages about missing page title being shown on
the initial page view.

We were also doing some weird checks to distinguish the two forms by
the GET/POST method. Instead, use setFormIdentifier() to do it, which
avoids similar error messages about content model being shown before
the user had a chance to fill in that field.

Bug: T196514
Change-Id: Id007f2db5238ed2a8123c6cc309dce361b9220cb
2020-06-17 20:45:36 +00:00
jenkins-bot
a5b4b456e2 Merge "Replace last usage, hard deprecate WikiPage::updateIfNewerOn" 2020-06-17 18:35:47 +00:00
jenkins-bot
a665937000 Merge "mediawiki-docker: Add a jobrunner container" 2020-06-17 17:19:00 +00:00
Umherirrender
e2cccfc384 Remove falsy check after new call
A new call can never return null or false

Change-Id: Ia80f090678e4335f09553676220f3a10861b7028
2020-06-17 19:03:16 +02:00
AronDemian
d459dfcb8f [cleanup] Reduce cognitive complexity of makeToolbox()
Per sonarcloud's request in I664fe4c3e2f3c4febf2c229d71482eee0ff8df3d...

Change-Id: Idc277921c405ccb82a10b863c6072fe5c5121315
2020-06-17 18:15:13 +02:00
jenkins-bot
37c71fd1be Merge "resourceloader: Add missing documentation comment in VueComponentParser" 2020-06-17 15:54:06 +00:00
Roan Kattouw
695f920e60 resourceloader: Add missing documentation comment in VueComponentParser
For some reason this was the only undocumented method in the whole file.

Change-Id: I50e7306a44af6ecd7649268615c6486fd7eb324a
2020-06-17 15:32:27 +00:00