Merge "Remove unneeded explicit true/false inside conditions"
This commit is contained in:
commit
1c623e395d
15 changed files with 22 additions and 22 deletions
|
|
@ -2031,7 +2031,7 @@ class EditPage implements IEditObject {
|
|||
);
|
||||
|
||||
// Check the constraints
|
||||
if ( $constraintRunner->checkConstraints() === false ) {
|
||||
if ( !$constraintRunner->checkConstraints() ) {
|
||||
$failed = $constraintRunner->getFailedConstraint();
|
||||
|
||||
// Need to check SpamRegexConstraint here, to avoid needing to pass
|
||||
|
|
@ -2081,7 +2081,7 @@ class EditPage implements IEditObject {
|
|||
);
|
||||
|
||||
// Check the constraints
|
||||
if ( $constraintRunner->checkConstraints() === false ) {
|
||||
if ( !$constraintRunner->checkConstraints() ) {
|
||||
$failed = $constraintRunner->getFailedConstraint();
|
||||
$this->handleFailedConstraint( $failed );
|
||||
return Status::wrap( $failed->getLegacyStatus() );
|
||||
|
|
@ -2261,7 +2261,7 @@ class EditPage implements IEditObject {
|
|||
);
|
||||
}
|
||||
// Check the constraints
|
||||
if ( $constraintRunner->checkConstraints() === false ) {
|
||||
if ( !$constraintRunner->checkConstraints() ) {
|
||||
$failed = $constraintRunner->getFailedConstraint();
|
||||
$this->handleFailedConstraint( $failed );
|
||||
return Status::wrap( $failed->getLegacyStatus() );
|
||||
|
|
@ -2319,7 +2319,7 @@ class EditPage implements IEditObject {
|
|||
)
|
||||
);
|
||||
// Check the constraints
|
||||
if ( $constraintRunner->checkConstraints() === false ) {
|
||||
if ( !$constraintRunner->checkConstraints() ) {
|
||||
$failed = $constraintRunner->getFailedConstraint();
|
||||
$this->handleFailedConstraint( $failed );
|
||||
return Status::wrap( $failed->getLegacyStatus() );
|
||||
|
|
|
|||
|
|
@ -453,7 +453,7 @@ class Linker {
|
|||
$label = $frameParams['title'];
|
||||
}
|
||||
$s = self::makeBrokenImageLinkObj(
|
||||
$title, $label, '', '', '', $time == true, $handlerParams
|
||||
$title, $label, '', '', '', (bool)$time, $handlerParams
|
||||
);
|
||||
} else {
|
||||
self::processResponsiveImages( $file, $thumb, $handlerParams );
|
||||
|
|
@ -713,7 +713,7 @@ class Linker {
|
|||
$label = $frameParams['title'];
|
||||
}
|
||||
$s .= self::makeBrokenImageLinkObj(
|
||||
$title, $label, '', '', '', $time == true, $handlerParams
|
||||
$title, $label, '', '', '', (bool)$time, $handlerParams
|
||||
);
|
||||
$zoomIcon = '';
|
||||
} elseif ( !$thumb ) {
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class RollbackAction extends FormAction {
|
|||
* @throws ThrottledError
|
||||
*/
|
||||
public function show() {
|
||||
if ( $this->getUser()->getOption( 'showrollbackconfirmation' ) == false ||
|
||||
if ( !$this->getUser()->getOption( 'showrollbackconfirmation' ) ||
|
||||
$this->getRequest()->wasPosted() ) {
|
||||
$this->handleRollbackRequest();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ViewAction extends FormlessAction {
|
|||
MediaWikiServices::getInstance()->getHookContainer()->emitDeprecationWarnings();
|
||||
|
||||
if (
|
||||
$config->get( 'DebugToolbar' ) == false && // don't let this get stuck on pages
|
||||
!$config->get( 'DebugToolbar' ) && // don't let this get stuck on pages
|
||||
$this->getWikiPage()->checkTouched() // page exists and is not a redirect
|
||||
) {
|
||||
// Include any redirect in the last-modified calculation
|
||||
|
|
|
|||
|
|
@ -2005,9 +2005,9 @@ class LocalFile extends File {
|
|||
$wikiPage->setFile( $this );
|
||||
|
||||
// Determine log action. If reupload is done by reverting, use a special log_action.
|
||||
if ( $revert === true ) {
|
||||
if ( $revert ) {
|
||||
$logAction = 'revert';
|
||||
} elseif ( $reupload === true ) {
|
||||
} elseif ( $reupload ) {
|
||||
$logAction = 'overwrite';
|
||||
} else {
|
||||
$logAction = 'upload';
|
||||
|
|
@ -2035,7 +2035,7 @@ class LocalFile extends File {
|
|||
$logId = $logEntry->insert();
|
||||
|
||||
if ( $descTitle->exists() ) {
|
||||
if ( $createNullRevision !== false ) {
|
||||
if ( $createNullRevision ) {
|
||||
$revStore = MediaWikiServices::getInstance()->getRevisionStore();
|
||||
// Use own context to get the action text in content language
|
||||
$formatter = LogFormatter::newFromEntry( $logEntry );
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ class HTMLMultiSelectField extends HTMLFormField implements HTMLNestedFilterable
|
|||
parent::__construct( $params );
|
||||
|
||||
// If the disabled-options parameter is not provided, use an empty array
|
||||
if ( isset( $this->mParams['disabled-options'] ) === false ) {
|
||||
if ( !isset( $this->mParams['disabled-options'] ) ) {
|
||||
$this->mParams['disabled-options'] = [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ class HTMLTextAreaField extends HTMLFormField {
|
|||
$val = $this->mParams['spellcheck'] ?? null;
|
||||
if ( is_bool( $val ) ) {
|
||||
// "spellcheck" attribute literally requires "true" or "false" to work.
|
||||
return $val === true ? 'true' : 'false';
|
||||
return $val ? 'true' : 'false';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ class HTMLTextField extends HTMLFormField {
|
|||
$val = $this->mParams['spellcheck'] ?? null;
|
||||
if ( is_bool( $val ) ) {
|
||||
// "spellcheck" attribute literally requires "true" or "false" to work.
|
||||
return $val === true ? 'true' : 'false';
|
||||
return $val ? 'true' : 'false';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -654,7 +654,7 @@ class WebInstaller extends Installer {
|
|||
$html = ( $text instanceof HtmlArmor ) ?
|
||||
HtmlArmor::getHtml( $text ) :
|
||||
$this->parse( $text, true );
|
||||
$icon = ( $icon == false ) ?
|
||||
$icon = ( !$icon ) ?
|
||||
'images/info-32.png' :
|
||||
'images/' . $icon;
|
||||
$alt = wfMessage( 'config-information' )->text();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class TimestampType extends Type {
|
|||
public function getSQLDeclaration( array $fieldDeclaration, AbstractPlatform $platform ) {
|
||||
if ( $platform->getName() == 'mysql' ) {
|
||||
// "infinite" (in expiry values has to be VARBINARY)
|
||||
if ( isset( $fieldDeclaration['allowInfinite'] ) && $fieldDeclaration['allowInfinite'] == true ) {
|
||||
if ( isset( $fieldDeclaration['allowInfinite'] ) && $fieldDeclaration['allowInfinite'] ) {
|
||||
return 'VARBINARY(14)';
|
||||
}
|
||||
return 'BINARY(14)';
|
||||
|
|
|
|||
|
|
@ -222,7 +222,7 @@ class VersionChecker {
|
|||
. 'in ' . $extension );
|
||||
}
|
||||
|
||||
if ( $constraint === true &&
|
||||
if ( $constraint &&
|
||||
$this->abilities[$ability] !== true
|
||||
) {
|
||||
// add custom error message for missing ability if specified
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ class SearchResultSet extends BaseSearchResultSet {
|
|||
return $this->results;
|
||||
}
|
||||
$this->rewind();
|
||||
while ( ( $result = $this->next() ) != false ) {
|
||||
while ( $result = $this->next() ) {
|
||||
$this->results[] = $result;
|
||||
}
|
||||
$this->rewind();
|
||||
|
|
|
|||
|
|
@ -1291,7 +1291,7 @@ abstract class UploadBase {
|
|||
|
||||
return true;
|
||||
}
|
||||
} elseif ( $match === true ) {
|
||||
} elseif ( $match ) {
|
||||
wfDebug( __METHOD__ . ": mime type $mime matches extension $extension, passing file" );
|
||||
|
||||
/** @todo If it's a bitmap, make sure PHP or ImageMagick resp. can handle it! */
|
||||
|
|
@ -2039,7 +2039,7 @@ abstract class UploadBase {
|
|||
return [ 'warning' => 'page-exists', 'file' => $file ];
|
||||
}
|
||||
|
||||
if ( strpos( $file->getName(), '.' ) == false ) {
|
||||
if ( !strpos( $file->getName(), '.' ) ) {
|
||||
$partname = $file->getName();
|
||||
$extension = '';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class Sqlite {
|
|||
try {
|
||||
foreach ( $files as $file ) {
|
||||
$err = $db->sourceFile( $file );
|
||||
if ( $err != true ) {
|
||||
if ( $err ) {
|
||||
return $err;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ class DeleteAutoPatrolLogs extends Maintenance {
|
|||
continue;
|
||||
}
|
||||
|
||||
if ( $auto === true ) {
|
||||
if ( $auto ) {
|
||||
$autopatrols[] = $row->log_id;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue