aboutsummaryrefslogtreecommitdiffstats
path: root/includes/htmlform
diff options
context:
space:
mode:
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>2022-08-05 19:20:25 +0000
committerGerrit Code Review <gerrit@wikimedia.org>2022-08-05 19:20:25 +0000
commitf6721b237ad59a9f0e5bc7a7135f284d9d96d1f9 (patch)
treede78da2f981fd71f87e6412a4d3c8a1240fedf43 /includes/htmlform
parent13f346fee23cf74f6d10b40a0b127ac1a0f9cb82 (diff)
parente23b070b4547b6a886519d92dacbb36fbd8511f3 (diff)
downloadmediawikicore-f6721b237ad59a9f0e5bc7a7135f284d9d96d1f9.tar.gz
mediawikicore-f6721b237ad59a9f0e5bc7a7135f284d9d96d1f9.zip
Merge "Make use of ?? and ?: operators where it makes sense"
Diffstat (limited to 'includes/htmlform')
-rw-r--r--includes/htmlform/fields/HTMLNamespacesMultiselectField.php7
-rw-r--r--includes/htmlform/fields/HTMLTagMultiselectField.php7
-rw-r--r--includes/htmlform/fields/HTMLTitlesMultiselectField.php7
-rw-r--r--includes/htmlform/fields/HTMLUsersMultiselectField.php7
4 files changed, 8 insertions, 20 deletions
diff --git a/includes/htmlform/fields/HTMLNamespacesMultiselectField.php b/includes/htmlform/fields/HTMLNamespacesMultiselectField.php
index e17320cb8cbd..b90c25d391ae 100644
--- a/includes/htmlform/fields/HTMLNamespacesMultiselectField.php
+++ b/includes/htmlform/fields/HTMLNamespacesMultiselectField.php
@@ -81,11 +81,8 @@ class HTMLNamespacesMultiselectField extends HTMLSelectNamespace {
$params['default'] = $this->mParams['default'];
}
- if ( isset( $this->mParams['placeholder'] ) ) {
- $params['placeholder'] = $this->mParams['placeholder'];
- } else {
- $params['placeholder'] = $this->msg( 'mw-widgets-titlesmultiselect-placeholder' )->plain();
- }
+ $params['placeholder'] = $this->mParams['placeholder'] ??
+ $this->msg( 'mw-widgets-titlesmultiselect-placeholder' )->plain();
if ( isset( $this->mParams['max'] ) ) {
$params['tagLimit'] = $this->mParams['max'];
diff --git a/includes/htmlform/fields/HTMLTagMultiselectField.php b/includes/htmlform/fields/HTMLTagMultiselectField.php
index 62e040b60927..c832cbbb51e4 100644
--- a/includes/htmlform/fields/HTMLTagMultiselectField.php
+++ b/includes/htmlform/fields/HTMLTagMultiselectField.php
@@ -80,11 +80,8 @@ class HTMLTagMultiselectField extends HTMLTextField {
$params['default'] = $this->mParams['default'];
}
- if ( isset( $this->mParams['placeholder'] ) ) {
- $params['placeholder'] = $this->mParams['placeholder'];
- } else {
- $params['placeholder'] = $this->msg( 'mw-widgets-tagmultiselect-placeholder' )->plain();
- }
+ $params['placeholder'] = $this->mParams['placeholder'] ??
+ $this->msg( 'mw-widgets-tagmultiselect-placeholder' )->plain();
if ( isset( $this->mParams['max'] ) ) {
$params['tagLimit'] = $this->mParams['max'];
diff --git a/includes/htmlform/fields/HTMLTitlesMultiselectField.php b/includes/htmlform/fields/HTMLTitlesMultiselectField.php
index 5f41bb137423..c21d129c77a6 100644
--- a/includes/htmlform/fields/HTMLTitlesMultiselectField.php
+++ b/includes/htmlform/fields/HTMLTitlesMultiselectField.php
@@ -92,11 +92,8 @@ class HTMLTitlesMultiselectField extends HTMLTitleTextField {
$params['default'] = $this->mParams['default'];
}
- if ( isset( $this->mParams['placeholder'] ) ) {
- $params['placeholder'] = $this->mParams['placeholder'];
- } else {
- $params['placeholder'] = $this->msg( 'mw-widgets-titlesmultiselect-placeholder' )->plain();
- }
+ $params['placeholder'] = $this->mParams['placeholder'] ??
+ $this->msg( 'mw-widgets-titlesmultiselect-placeholder' )->plain();
if ( isset( $this->mParams['max'] ) ) {
$params['tagLimit'] = $this->mParams['max'];
diff --git a/includes/htmlform/fields/HTMLUsersMultiselectField.php b/includes/htmlform/fields/HTMLUsersMultiselectField.php
index acdae75f7b32..3fa0ab0a9665 100644
--- a/includes/htmlform/fields/HTMLUsersMultiselectField.php
+++ b/includes/htmlform/fields/HTMLUsersMultiselectField.php
@@ -101,11 +101,8 @@ class HTMLUsersMultiselectField extends HTMLUserTextField {
$params['default'] = $this->mParams['default'];
}
- if ( isset( $this->mParams['placeholder'] ) ) {
- $params['placeholder'] = $this->mParams['placeholder'];
- } else {
- $params['placeholder'] = $this->msg( 'mw-widgets-usersmultiselect-placeholder' )->plain();
- }
+ $params['placeholder'] = $this->mParams['placeholder'] ??
+ $this->msg( 'mw-widgets-usersmultiselect-placeholder' )->plain();
if ( isset( $this->mParams['max'] ) ) {
$params['tagLimit'] = $this->mParams['max'];