Condense and simplify some conditionals/returns

Change-Id: Ibfc8ad6375555cfafb649dc96c91b5415a8ea0ff
This commit is contained in:
Reedy 2023-08-22 19:54:10 +01:00
parent d3dabf0cca
commit a8456c035b
3 changed files with 5 additions and 11 deletions

View file

@ -95,9 +95,10 @@ class HTMLAutoCompleteSelectField extends HTMLTextField {
$validOptions = HTMLFormField::flattenOptions( $this->getOptions() ?: [] );
if ( in_array( strval( $value ), $validOptions, true ) ) {
return true;
} elseif ( in_array( strval( $value ), $this->autocompleteData, true ) ) {
if (
in_array( strval( $value ), $validOptions, true ) ||
in_array( strval( $value ), $this->autocompleteData, true )
) {
return true;
} elseif ( $this->mParams['require-match'] ) {
return $this->msg( 'htmlform-select-badoption' );

View file

@ -598,7 +598,6 @@ class BlockLevelPass {
__METHOD__ . ": Invalid input; not enough close tags " .
"(level $ltLevel/$lcLevel, state $state)"
);
return false;
}
return false;
}

View file

@ -3181,13 +3181,7 @@ class OutputPageTest extends MediaWikiIntegrationTestCase {
string $permission,
PageIdentity $page
) {
if ( $permission === 'edit' | $permission === 'create' ) {
if ( $page->getDBkey() === 'RelevantTitle' ) {
return true;
}
return false;
}
return false;
return ( $permission === 'edit' || $permission === 'create' ) && $page->getDBkey() === 'RelevantTitle';
} ),
'expectedEditableConfig' => [
'wgIsProbablyEditable' => false,