http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73809
Revision: 73809
Author: demon
Date: 2010-09-27 14:24:13 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
Fix a bunch of '? true : false' instances
Modified Paths:
--------------
trunk/phase3/includes/Autopromote.php
trunk/phase3/includes/Skin.php
trunk/phase3/includes/SkinTemplate.php
trunk/phase3/includes/WebRequest.php
trunk/phase3/includes/db/DatabasePostgres.php
trunk/phase3/includes/installer/WebInstallerPage.php
trunk/phase3/includes/specials/SpecialAllmessages.php
trunk/phase3/includes/specials/SpecialBlockip.php
trunk/phase3/includes/specials/SpecialContributions.php
trunk/phase3/includes/specials/SpecialSearch.php
Modified: trunk/phase3/includes/Autopromote.php
===================================================================
--- trunk/phase3/includes/Autopromote.php 2010-09-27 13:06:58 UTC (rev
73808)
+++ trunk/phase3/includes/Autopromote.php 2010-09-27 14:24:13 UTC (rev
73809)
@@ -143,7 +143,7 @@
throw new MWException( "Unrecognized
condition {$cond[0]} for autopromotion!" );
}
- return $result ? true : false;
+ return (bool)$result;
}
}
}
Modified: trunk/phase3/includes/Skin.php
===================================================================
--- trunk/phase3/includes/Skin.php 2010-09-27 13:06:58 UTC (rev 73808)
+++ trunk/phase3/includes/Skin.php 2010-09-27 14:24:13 UTC (rev 73809)
@@ -2046,7 +2046,7 @@
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0 ? true : false
+ 'exists' => $title->getArticleID() != 0;
);
}
Modified: trunk/phase3/includes/SkinTemplate.php
===================================================================
--- trunk/phase3/includes/SkinTemplate.php 2010-09-27 13:06:58 UTC (rev
73808)
+++ trunk/phase3/includes/SkinTemplate.php 2010-09-27 14:24:13 UTC (rev
73809)
@@ -659,7 +659,7 @@
self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0 ? true : false
+ 'exists' => $title->getArticleID() != 0,
);
}
@@ -669,7 +669,7 @@
self::checkTitle( $title, $name );
return array(
'href' => $title->getLocalURL( $urlaction ),
- 'exists' => $title->getArticleID() != 0 ? true : false
+ 'exists' => $title->getArticleID() != 0,
);
}
Modified: trunk/phase3/includes/WebRequest.php
===================================================================
--- trunk/phase3/includes/WebRequest.php 2010-09-27 13:06:58 UTC (rev
73808)
+++ trunk/phase3/includes/WebRequest.php 2010-09-27 14:24:13 UTC (rev
73809)
@@ -345,7 +345,7 @@
* @return Boolean
*/
public function getBool( $name, $default = false ) {
- return $this->getVal( $name, $default ) ? true : false;
+ return (bool)$this->getVal( $name, $default );
}
/**
Modified: trunk/phase3/includes/db/DatabasePostgres.php
===================================================================
--- trunk/phase3/includes/db/DatabasePostgres.php 2010-09-27 13:06:58 UTC
(rev 73808)
+++ trunk/phase3/includes/db/DatabasePostgres.php 2010-09-27 14:24:13 UTC
(rev 73809)
@@ -1179,7 +1179,7 @@
. "AND c.relkind IN ('" . implode( "','", $types ) .
"')";
$res = $this->query( $SQL );
$count = $res ? $res->numRows() : 0;
- return $count ? true : false;
+ return (bool)$count;
}
/**
Modified: trunk/phase3/includes/installer/WebInstallerPage.php
===================================================================
--- trunk/phase3/includes/installer/WebInstallerPage.php 2010-09-27
13:06:58 UTC (rev 73808)
+++ trunk/phase3/includes/installer/WebInstallerPage.php 2010-09-27
14:24:13 UTC (rev 73809)
@@ -487,7 +487,7 @@
// 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;
Modified: trunk/phase3/includes/specials/SpecialAllmessages.php
===================================================================
--- trunk/phase3/includes/specials/SpecialAllmessages.php 2010-09-27
13:06:58 UTC (rev 73808)
+++ trunk/phase3/includes/specials/SpecialAllmessages.php 2010-09-27
14:24:13 UTC (rev 73809)
@@ -100,19 +100,19 @@
'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>
@@ -124,7 +124,7 @@
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' ) .
Modified: trunk/phase3/includes/specials/SpecialBlockip.php
===================================================================
--- trunk/phase3/includes/specials/SpecialBlockip.php 2010-09-27 13:06:58 UTC
(rev 73808)
+++ trunk/phase3/includes/specials/SpecialBlockip.php 2010-09-27 14:24:13 UTC
(rev 73809)
@@ -188,7 +188,7 @@
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',
Modified: trunk/phase3/includes/specials/SpecialContributions.php
===================================================================
--- trunk/phase3/includes/specials/SpecialContributions.php 2010-09-27
13:06:58 UTC (rev 73808)
+++ trunk/phase3/includes/specials/SpecialContributions.php 2010-09-27
14:24:13 UTC (rev 73809)
@@ -346,9 +346,9 @@
$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' => ''
Modified: trunk/phase3/includes/specials/SpecialSearch.php
===================================================================
--- trunk/phase3/includes/specials/SpecialSearch.php 2010-09-27 13:06:58 UTC
(rev 73808)
+++ trunk/phase3/includes/specials/SpecialSearch.php 2010-09-27 14:24:13 UTC
(rev 73809)
@@ -67,7 +67,7 @@
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();
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs