Commit graph

20 commits

Author SHA1 Message Date
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Max Semenik
6e956d55aa Replace call_user_func_array(), part 2
Uses new PHP 5.6 syntax like ...parameter unpacking and
calling anything looking like a callback to make the code more readable.
There are much more occurrences but this commit is intentionally limited
to an easily reviewable size.

In one occurrence, a simple conditional instead of trickery was much more readable.

This patch finishes all the easy stuf in the core, the remainder is either unobvious
or would result in smaller readability gains. It will be carefully dealt with in
further commits.

Change-Id: I79a16c48bfb98b75e5b99f2f6f4fa07b3ae02c5b
2018-06-07 20:19:26 -07:00
Thiemo Mättig
ef470ebf7f Remove @param comments that literally repeat what the code says
These comments do not add anything. I argue they are worse than having
no comments, because I have to read them first to understand they
actually don't explain anything. Removing them makes room for actual
improvements in the future (if needed).

Change-Id: Iee70aad681b3385e9af282d5581c10addbb91ac4
2018-01-10 14:14:26 +01:00
Thiemo Mättig
c785efd25e Fix and make some types in PHPDoc and JSDoc tags more specific
Change-Id: I7c109067579f570ecccaabc75b0b4db7eac4e6c2
2017-08-05 18:46:44 +02:00
jenkins-bot
aa3319c4c0 Merge "Miscellaneous indentation tweaks" 2017-02-28 18:38:36 +00:00
Bartosz Dziewoński
ecdef925bb Miscellaneous indentation tweaks
I was bored. What? Don't look at me that way.

I mostly targetted mixed tabs and spaces, but others were not spared.
Note that some of the whitespace changes are inside HTML output,
extended regexps or SQL snippets.

Change-Id: Ie206cc946459f6befcfc2d520e35ad3ea3c0f1e0
2017-02-27 19:23:54 +01:00
addshore
a28fa6b546 Fix StatusValue::setResult phpdoc typo
Change-Id: If727e357d4deb138ec4e391f231b074677ec2437
2017-02-27 09:18:03 +00:00
jenkins-bot
91267f914e Merge "Improve Status/StatusValue::splitByErrorType type hint" 2016-10-24 05:11:30 +00:00
Gergő Tisza
1bcff02923 Force boolean type for $ok in StatusValue::setResult
Change-Id: Ie9e933fba3445872e39d70ab3a8230f204106996
2016-10-24 04:07:53 +00:00
Gergő Tisza
223aa1e97e Improve Status/StatusValue::splitByErrorType type hint
Change-Id: I6deb76f8906aa86481b84ce1aaebaddf3a52e31d
2016-10-24 00:50:40 +00:00
Aaron Schulz
25a1651aad Make LockManager use StatusValue and move classes to /libs
Change-Id: Ifa41fc2939f3515d4a056746b0fcbff79786d25b
2016-09-19 04:34:28 +00:00
Aaron Schulz
c64c3ef9a8 Make Status extend StatusValue and start FileBackend update
* This avoids code duplication.
* Callers can safely start type-hinting StatusValue as well.
* Also moved the wrap() logic out of Status::__construct(), which
  only wrap() was (and should have been) using. Use "static" as
  well, so subclass behave properly.
* The docs and type-hints in /filebackend are updated as an example.
* A migration pattern is to inject a StatusValue wrapper
  into the backend and use it on all returned statuses, so MediaWiki
  will still get Status for message methods.

Change-Id: Iff9255f34870ea6b0c4b91f6ddc69eea95186aba
2016-09-17 15:45:40 -07:00
jenkins-bot
f0d760a077 Merge "Show warnings in HTMLForm and warnings as warnings on Login/Signup form" 2016-09-17 18:05:13 +00:00
Florian
3706dcb5c7 Show warnings in HTMLForm and warnings as warnings on Login/Signup form
This commit changes the way how HTMLForm handles a Status object
when executed from a request. It now handles, beside the errors,
also the warnings of a Status object and prints them out, wrapped
in a warning box.

The LoginSignupPage uses this feature to show informative warnings
actually as warnings and not as more disturbing error messages.
Error messages should be reserved for errors and only for erros. An
AuthenticationProvider, which returns an UI AuthenticationResponse
can choose, if the given message is an error or a warning message.

This commit also addds a new function to Status, which allows a
developer to split the object into two new Status objects, where one only
contains the errors and the other only the warnings of the origin
Status object (splitByErrorType). StatusValue also has a new function,
splitByErrorType(), to support this.

Bug: T139179
Change-Id: I9a27911613e62b5c4cb86bea40696cb37c4f49c2
2016-09-17 16:33:39 +02:00
Aaron Schulz
6674490e7f Fix type doc in StatusValue
Change-Id: Ib0a3282083b2fd08ea76022b74b21b55da9b8a46
2016-09-16 17:38:10 -07:00
Aaron Schulz
75752d58ee Improve getErrorsByType() docs
Change-Id: I235a82ee1036d59a0f4929fc2170f261280f9b4d
2016-04-18 09:08:26 -07:00
Gergő Tisza
949641e36e Fix StatusValue phpdoc
Change-Id: Ie30ebf9bd89c4e2594e806a1b52f5716a32e11ec
2016-04-01 15:44:10 +03:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
addshore
b796300aa6 Fix phpdoc of StatusValue::merge
Change-Id: I6fec36f9911d647fa7507c36b57f6b11ef04d63d
2015-12-04 21:50:22 +01:00
Aaron Schulz
c15caa6d53 Split StatusValue out of Status class and put it in /libs
* Deprecated useless FileRepoStatus class

Change-Id: I015635a9bf080ef6d98b2cff49b949c4378a859f
2015-02-10 00:39:05 +00:00