From ef220ef5dca71ddbf96bb873b9adcb2ff290721b Mon Sep 17 00:00:00 2001 From: Derick Alangi Date: Mon, 11 Feb 2019 15:59:36 +0100 Subject: [PATCH] widgets: Remove redundant equality check in SelectWithInputWidget The check `if ( $config['disabled'] == true )` is the same as the check `if ( $config['disabled'] )`. Was this intentional or was it supposed to be a test for equality and type (===)? If not, then I think this patch removes the irrelevancy. Clearly, if the $config['disabled'] is set to false, the isset() check will return true but the second check will fail even with this patch as it does the same thing. Change-Id: Ibbe5b4949590f8ac954f613236056dd2e6dd18ba --- includes/widget/SelectWithInputWidget.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/widget/SelectWithInputWidget.php b/includes/widget/SelectWithInputWidget.php index 262903dd39..de0e4a63d1 100644 --- a/includes/widget/SelectWithInputWidget.php +++ b/includes/widget/SelectWithInputWidget.php @@ -23,7 +23,7 @@ class SelectWithInputWidget extends \OOUI\Widget { * - array $config['textinput'] Configuration for the TextInputWidget * - array $config['dropdowninput'] Configuration for the DropdownInputWidget * - bool $config['or'] Configuration for whether the widget is dropdown AND input - * or dropdown OR input + * or dropdown OR input */ public function __construct( array $config = [] ) { // Configuration initialization @@ -36,7 +36,7 @@ class SelectWithInputWidget extends \OOUI\Widget { $config ); - if ( isset( $config['disabled'] ) && $config['disabled'] == true ) { + if ( isset( $config['disabled'] ) && $config['disabled'] ) { $config['textinput']['disabled'] = true; $config['dropdowninput']['disabled'] = true; } -- 2.20.1