Commit graph

14 commits

Author SHA1 Message Date
Umherirrender
ca24df16af redis: Check last error for null before using preg_match
preg_match should not be called with null value

Found by phan strict checks

Change-Id: I7c2147931ab0e92213f66ca7fb3a24b1468dbe21
2022-03-05 19:52:18 +01:00
Siddharth VP
38295f9226 Fix typos in comments (N-R)
Change-Id: I2d1bdb7531ff5126114a391550c2615ea6e244b3
2022-01-09 23:14:44 +05:30
Thiemo Kreuz
2ba01c7ee7 Remove some more comments that literally repeat the code
… including PHPDoc tags like `@return <type> $variableName`.
A return value doesn't have a variable name. I can see that
some people do this intentionally, repeating the variable
name that was used in the final `return $var;` at the end
of a method. This can indeed be helpful. I leave a lot of
these untouched and removed them only when it's obviously
wrong, or does not provide any additional information in
addition to what the code already says.

Change-Id: Ia18cd9f25ef658b08ad25b97a744897e2a8deffc
2021-06-18 21:23:56 +00:00
Umherirrender
0d706ed09e Return directly from within try/finally block
It is good code style to return a variable from the same scope as it is
definied and not from a level deeper.
For try/finally blocks this does not change the behaviour because the
finally block is executed if the scope is leaved, normally or by return
or by thrown exception.

This helps static code analyzer like phan to understand the code better.

Change-Id: Ib947e58adb3676b1d69507a15ea44d93c5a9973d
2020-07-20 15:54:32 +00:00
Reedy
40e522747c Fix some includes/libs PSR12.Properties.ConstantVisibility.NotFound
Change-Id: I92e2cbf39d2851d215e8be456e86bb99524dea5f
2020-05-16 02:32:53 +01:00
James D. Forrester
4f2d1efdda Coding style: Auto-fix MediaWiki.Classes.UnsortedUseStatements.UnsortedUse
Change-Id: I94a0ae83c65e8ee419bbd1ae1e86ab21ed4d8210
2020-01-10 09:32:25 -08:00
Umherirrender
eb2373dcd1 Set visibility on php magic functions __destruct/sleep/wakeup/get/call
All the magic functions needs public visibility to be callable from php
internals like garbage collector

Change-Id: I1baf04bf8ff787da880d46e4a6daa77f5a6de73f
2019-12-05 18:52:55 +01:00
Thiemo Kreuz
ac9fa2d336 redis: Fix incomplete @var documentation in RedisConnRef
Change-Id: Id6cf3731986a004ffa80611fcf02c43fd6609ff1
2019-02-27 16:33:55 +01:00
Jakub Vrana
d685145027 Fix return typehint
Found by PHPStan.

Change-Id: I2e649aa85c84925886b6acfba2bbdde1a4f12214
2018-12-11 12:35:21 +00:00
Umherirrender
130ec2523d Fix PhanTypeMismatchDeclaredParam
Auto fix MediaWiki.Commenting.FunctionComment.DefaultNullTypeParam sniff

Change-Id: I865323fd0295aabd06f3e3c75e0e5043fb31069e
2018-07-07 00:34:30 +00:00
Max Semenik
1e680456b4 Get rid of call_user_func(_array)(), part 3
Also cleaned up nearby code in a couple places.

Change-Id: Ibf44ee7c0ceb739d7e79406e4ff39303c316e285
2018-06-10 02:21:24 +00:00
Alexia E. Smith
9e3d7c14ae clientpool: refactor Redis authentication error handling
Wrap method calls with a try-catch handler.

Also:
* Fixed blpop/brpop/brpoplpush timeout parameter.
* Fixed blpop/brpop/brpoplpush clobbering infinite timeouts.
* Redis scan functions require iterator passed by reference.

Bug: T191927
Change-Id: I1f827ab23c8d289d000090dbdd62a10467c4afed
2018-05-31 21:46:37 +00:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Aaron Schulz
10593ffaab Move RedisConnectionPool to /libs/redis
Change-Id: Ied4a85d7172ab76b90f6d9ce4d47a83c3fd7d111
2016-09-23 00:20:19 -07:00