ObjectFactory: avoid using ReflectionClass
authorBryan Davis <bd808@wikimedia.org>
Sat, 24 Oct 2015 18:42:07 +0000 (12:42 -0600)
committerOri.livneh <ori@wikimedia.org>
Sun, 25 Oct 2015 00:13:32 +0000 (00:13 +0000)
commitfecb2320a8cbe72339a12d204590a7a184b082a3
treec6378db0774daed2a88dc90de5e3ca0991d10cc4
parentb9778e1a10daf1255ade6370cc8db7b6b243350b
ObjectFactory: avoid using ReflectionClass

Add a new ObjectFactory::constructClassInstance() method that uses
a loop unrolling type of technique to avoid using ReflectionClass when
creating new class instances with 10 or fewer constructor arguments.

I really wanted to also include the use of PHP 5.6's `...` splat
operator when supported but there is no way to conditionally use a new
operator in a way that still allows older versions of PHP to parse the
same source file.

Bug: T115729
Change-Id: Ia29c4526f4bac51696654c9b0677cb3f70359966
includes/libs/ObjectFactory.php
tests/phpunit/includes/libs/ObjectFactoryTest.php