From: Kunal Mehta Date: Tue, 4 Jun 2019 19:45:38 +0000 (-0400) Subject: HTMLForm: Use PHP 5.6 splat operator directly instead of ObjectFactory X-Git-Tag: 1.34.0-rc.0~1522^2 X-Git-Url: http://git.cyclocoop.org//%22javascript:ModifierStyle%28%27%22.%24id.%22%27%29/%22?a=commitdiff_plain;h=8665536045cf81dfbd1cdbeee19eebe3a239297a;p=lhc%2Fweb%2Fwiklou.git HTMLForm: Use PHP 5.6 splat operator directly instead of ObjectFactory Change-Id: I3fddf30f1b0fc2cce79f652cb71efba119439a9f --- diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index acf64db346..d071478440 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -21,8 +21,6 @@ * @file */ -use Wikimedia\ObjectFactory; - /** * Object handling generic submission, CSRF protection, layout and * other logic for UI forms. in a reusable manner. @@ -304,12 +302,11 @@ class HTMLForm extends ContextSource { switch ( $displayFormat ) { case 'vform': - return ObjectFactory::constructClassInstance( VFormHTMLForm::class, $arguments ); + return new VFormHTMLForm( ...$arguments ); case 'ooui': - return ObjectFactory::constructClassInstance( OOUIHTMLForm::class, $arguments ); + return new OOUIHTMLForm( ...$arguments ); default: - /** @var HTMLForm $form */ - $form = ObjectFactory::constructClassInstance( self::class, $arguments ); + $form = new self( ...$arguments ); $form->setDisplayFormat( $displayFormat ); return $form; }