throw new MWException( "Unrecognized condition {$cond[0]} for autopromotion!" );
}
- return $result ? true : false;
+ return (bool)$result;
}
}
}
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0 ? true : false
+ 'exists' => $title->getArticleID() != 0;
);
}
self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0 ? true : false
+ 'exists' => $title->getArticleID() != 0,
);
}
self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0 ? true : false
+ 'exists' => $title->getArticleID() != 0,
);
}
* @return Boolean
*/
public function getBool( $name, $default = false ) {
- return $this->getVal( $name, $default ) ? true : false;
+ return (bool)$this->getVal( $name, $default );
}
/**
. "AND c.relkind IN ('" . implode( "','", $types ) . "')";
$res = $this->query( $SQL );
$count = $res ? $res->numRows() : 0;
- return $count ? true : false;
+ return (bool)$count;
}
/**
// Title-style validation
$title = Title::newFromText( $name );
if ( !$title ) {
- $good = $nsType == 'site-name' ? true : false;
+ $good = $nsType == 'site-name';
} else {
$name = $title->getDBkey();
$good = true;
'filter',
'unmodified',
'mw-allmessages-form-filter-unmodified',
- ( $this->filter == 'unmodified' ? true : false )
+ ( $this->filter == 'unmodified' )
) .
Xml::radioLabel( wfMsg( 'allmessages-filter-all' ),
'filter',
'all',
'mw-allmessages-form-filter-all',
- ( $this->filter == 'all' ? true : false )
+ ( $this->filter == 'all' )
) .
Xml::radioLabel( wfMsg( 'allmessages-filter-modified' ),
'filter',
'modified',
'mw-allmessages-form-filter-modified',
- ( $this->filter == 'modified' ? true : false )
+ ( $this->filter == 'modified' )
) .
"</td>\n
</tr>
Xml::openElement( 'select', array( 'id' => 'mw-allmessages-form-lang', 'name' => 'lang' ) );
foreach( $languages as $lang => $name ) {
- $selected = $lang == $this->langCode ? true : false;
+ $selected = $lang == $this->langCode;
$out .= Xml::option( $lang . ' - ' . $name, $lang, $selected ) . "\n";
}
$out .= Xml::closeElement( 'select' ) .
list( $show, $value ) = explode( ':', $option );
$show = htmlspecialchars( $show );
$value = htmlspecialchars( $value );
- $blockExpiryFormOptions .= Xml::option( $show, $value, $this->BlockExpiry === $value ? true : false ) . "\n";
+ $blockExpiryFormOptions .= Xml::option( $show, $value, $this->BlockExpiry === $value ) . "\n";
}
$reasonDropDown = Xml::listDropDown( 'wpBlockReasonList',
$f .= Xml::fieldset( wfMsg( 'sp-contributions-search' ) ) .
Xml::radioLabel( wfMsgExt( 'sp-contributions-newbies', array( 'parsemag' ) ),
- 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ? true : false ) . '<br />' .
+ 'contribs', 'newbie' , 'newbie', $this->opts['contribs'] == 'newbie' ) . '<br />' .
Xml::radioLabel( wfMsgExt( 'sp-contributions-username', array( 'parsemag' ) ),
- 'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ? true : false ) . ' ' .
+ 'contribs' , 'user', 'user', $this->opts['contribs'] == 'user' ) . ' ' .
Html::input( 'target', $this->opts['target'], 'text', array(
'size' => '20',
'required' => ''
if( empty( $this->namespaces ) ) {
$this->namespaces = SearchEngine::userNamespaces( $user );
}
- $this->searchRedirects = $request->getcheck( 'redirs' ) ? true : false;
+ $this->searchRedirects = $request->getCheck( 'redirs' );
$this->searchAdvanced = $request->getVal( 'advanced' );
$this->active = 'advanced';
$this->sk = $user->getSkin();