Change isset() checks for variables that are always defined.
Change-Id: Ic96b9661d94742909c0d6b62a8eb2f6a038a774f
&& isset( $wgFooterIcons['copyright']['copyright'] )
&& $wgFooterIcons['copyright']['copyright'] === array()
) {
- if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
+ if ( $wgCopyrightIcon ) {
$wgFooterIcons['copyright']['copyright'] = $wgCopyrightIcon;
} elseif ( $wgRightsIcon || $wgRightsText ) {
$wgFooterIcons['copyright']['copyright'] = array(
// Do tag settings
foreach ( $params['tags'] as $tag ) {
if ( array_key_exists( $tag, $thisSetting ) ) {
- if ( isset( $retval ) && is_array( $retval ) && is_array( $thisSetting[$tag] ) ) {
+ if ( is_array( $retval ) && is_array( $thisSetting[$tag] ) ) {
$retval = self::arrayMerge( $retval, $thisSetting[$tag] );
} else {
$retval = $thisSetting[$tag];
}
break 2;
} elseif ( array_key_exists( "+$tag", $thisSetting ) && is_array( $thisSetting["+$tag"] ) ) {
- if ( !isset( $retval ) ) {
+ if ( $retval === null ) {
$retval = array();
}
$retval = self::arrayMerge( $retval, $thisSetting["+$tag"] );
$suffix = $params['suffix'];
if ( !is_null( $suffix ) ) {
if ( array_key_exists( $suffix, $thisSetting ) ) {
- if ( isset( $retval ) && is_array( $retval ) && is_array( $thisSetting[$suffix] ) ) {
+ if ( is_array( $retval ) && is_array( $thisSetting[$suffix] ) ) {
$retval = self::arrayMerge( $retval, $thisSetting[$suffix] );
} else {
$retval = $thisSetting[$suffix];
} elseif ( array_key_exists( "+$suffix", $thisSetting )
&& is_array( $thisSetting["+$suffix"] )
) {
- if ( !isset( $retval ) ) {
+ if ( $retval === null ) {
$retval = array();
}
$retval = self::arrayMerge( $retval, $thisSetting["+$suffix"] );
$out = '';
- if ( isset( $wgCopyrightIcon ) && $wgCopyrightIcon ) {
+ if ( $wgCopyrightIcon ) {
$out = $wgCopyrightIcon;
} elseif ( $wgRightsIcon ) {
$icon = htmlspecialchars( $wgRightsIcon );
return false;
}
- if ( !isset( $this->mTitleProtection ) ) {
+ if ( $this->mTitleProtection === null ) {
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select(
'protected_titles',
* @since 1.23
*/
public function areCascadeProtectionSourcesLoaded( $getPages = true ) {
- return $getPages ? isset( $this->mCascadeSources ) : isset( $this->mHasCascadingRestrictions );
+ return $getPages ? $this->mCascadeSources !== null : $this->mHasCascadingRestrictions !== null;
}
/**
global $wgContLang;
$pagerestrictions = array();
- if ( isset( $this->mCascadeSources ) && $getPages ) {
+ if ( $this->mCascadeSources !== null && $getPages ) {
return array( $this->mCascadeSources, $this->mCascadingRestrictions );
- } elseif ( isset( $this->mHasCascadingRestrictions ) && !$getPages ) {
+ } elseif ( $this->mHasCascadingRestrictions !== null && !$getPages ) {
return array( $this->mHasCascadingRestrictions, $pagerestrictions );
}
# alone to cache the result. There's no point in having it hanging
# around uninitialized in every Title object; therefore we only add it
# if needed and don't declare it statically.
- if ( !isset( $this->mHasSubpages ) ) {
+ if ( $this->mHasSubpages === null ) {
$this->mHasSubpages = false;
$subpages = $this->getSubpages( 1 );
if ( $subpages instanceof TitleArray ) {
* @return string Last-touched timestamp
*/
public function getTouched( $db = null ) {
- $db = isset( $db ) ? $db : wfGetDB( DB_SLAVE );
+ if ( $db === null ) {
+ $db = wfGetDB( DB_SLAVE );
+ }
$touched = $db->selectField( 'page', 'page_touched', $this->pageCond(), __METHOD__ );
return $touched;
}
return null;
}
- if ( !isset( $this->mEditCount ) ) {
+ if ( $this->mEditCount === null ) {
/* Populate the count, if it has not been populated yet */
wfProfileIn( __METHOD__ );
$dbr = wfGetDB( DB_SLAVE );