From: Platonides Date: Tue, 4 Jun 2013 21:54:20 +0000 (+0200) Subject: HTMLCheckMatrix: Create the exceptions to be thrown directly X-Git-Tag: 1.31.0-rc.0~19310^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=20f4451345e8eeb1a8f7465ec5d3f7fd7452983b;p=lhc%2Fweb%2Fwiklou.git HTMLCheckMatrix: Create the exceptions to be thrown directly Instead of using a function to create itself. Just like it's done everywhere else in the code. Change-Id: Ib080a3eb2fc2c173f8bf07289beb976824447357 --- diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 33e447efd6..5af081be6e 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -1887,7 +1887,7 @@ class HTMLCheckMatrix extends HTMLFormField implements HTMLNestedFilterable { public function __construct( $params ) { $missing = array_diff( self::$requiredParams, array_keys( $params ) ); if ( $missing ) { - throw HTMLFormFieldRequiredOptionsException::create( $this, $missing ); + throw new HTMLFormFieldRequiredOptionsException( $this, $missing ); } parent::__construct( $params ); } @@ -2803,8 +2803,8 @@ interface HTMLNestedFilterable { } class HTMLFormFieldRequiredOptionsException extends MWException { - static public function create( HTMLFormField $field, array $missing ) { - return new self( sprintf( + public function __construct( HTMLFormField $field, array $missing ) { + parent::__construct( sprintf( "Form type `%s` expected the following parameters to be set: %s", get_class( $field ), implode( ', ', $missing )