From 8665536045cf81dfbd1cdbeee19eebe3a239297a Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 4 Jun 2019 15:45:38 -0400 Subject: [PATCH] HTMLForm: Use PHP 5.6 splat operator directly instead of ObjectFactory Change-Id: I3fddf30f1b0fc2cce79f652cb71efba119439a9f --- includes/htmlform/HTMLForm.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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; } -- 2.20.1