Commit graph

4 commits

Author SHA1 Message Date
Aryeh Gregor
7b4489e019 Get rid of unnecessary func_get_args() and friends
HHVM does not support variadic arguments with type hints.  This is
mostly not a big problem, because we can just drop the type hint, but
for some reason PHPUnit adds a type hint of "array" when it creates
mocks, so a class with a variadic method can't be mocked (at least in
some cases).  As such, I left alone all the classes that seem like
someone might like to mock them, like Title and User.  If anyone wants
to mock them in the future, they'll have to switch back to
func_get_args().  Some of the changes are definitely safe, like
functions and test classes.

In most cases, func_get_args() (and/or func_get_arg(), func_num_args() )
were only present because the code was written before we required PHP
5.6, and writing them as variadic functions is strictly superior. In
some cases I left them alone, aside from HHVM compatibility:

* Forwarding all arguments to another function. It's useful to keep
  func_get_args() here where we want to keep the list of expected
  arguments and their meanings in the function signature line for
  documentation purposes, but don't want to copy-paste a long line of
  argument names.
* Handling deprecated calling conventions.
* One or two miscellaneous cases where we're basically using the
  arguments individually but want to use them as an array as well for
  some reason.

Change-Id: I066ec95a7beb7c0665146195a08e7cce1222c788
2019-04-12 20:17:01 +00:00
星耀晨曦
dd1c59d0dc Soft deprecate DeferredStringifier class
As of 3041b5c, the DeferredStringifier class is no longer used in MediaWiki core or any Gerrit-hosted extensions.

Bug: T187290
Change-Id: Ic363daf0847c0371a6b4c4041f9ea394377185f3
2018-02-16 22:46:59 +00:00
Timo Tijhof
9f58d49a27 DeferredStringifier: Clean up comments and indentation in tests
Change-Id: Ifdf2fe711a0be495465255c6fabb55fe34b79b27
2015-01-29 12:10:08 -08:00
Kunal Mehta
6a55db1a97 Move DeferredStringifier into libs, add tests
Change-Id: I384d1a3854e957315584d30ec58c48c02fee6a2c
2015-01-13 11:04:44 -08:00
Renamed from includes/DeferredStringifier.php (Browse further)