Remove whitespace, unneeded globals, and swap and/or for &&/||

This commit is contained in:
Sam Reed 2011-04-27 11:11:54 +00:00
parent ee810308c5
commit 3e5bbe33e7
2 changed files with 4 additions and 6 deletions

View file

@ -234,7 +234,7 @@ class Cite {
return $this->error( 'cite_error_ref_too_many_keys' ); return $this->error( 'cite_error_ref_too_many_keys' );
} }
if ( $str === null and $key === null ) { if ( $str === null && $key === null ) {
# Something like <ref />; this makes no sense. # Something like <ref />; this makes no sense.
$this->mRefCallStack[] = false; $this->mRefCallStack[] = false;
return $this->error( 'cite_error_ref_no_key' ); return $this->error( 'cite_error_ref_no_key' );
@ -269,7 +269,7 @@ class Cite {
return $this->error( 'cite_error_included_ref' ); return $this->error( 'cite_error_included_ref' );
} }
if ( is_string( $key ) or is_string( $str ) ) { if ( is_string( $key ) || is_string( $str ) ) {
# We don't care about the content: if the key exists, the ref # We don't care about the content: if the key exists, the ref
# is presumptively valid. Either it stores a new ref, or re- # is presumptively valid. Either it stores a new ref, or re-
# fers to an existing one. If it refers to a nonexistent ref, # fers to an existing one. If it refers to a nonexistent ref,
@ -527,7 +527,7 @@ class Cite {
$this->mParser = $parser; $this->mParser = $parser;
if ( isset( $argv['group'] ) and $wgAllowCiteGroups ) { if ( isset( $argv['group'] ) && $wgAllowCiteGroups ) {
$group = $argv['group']; $group = $argv['group'];
unset ( $argv['group'] ); unset ( $argv['group'] );
} }
@ -595,7 +595,7 @@ class Cite {
* @return string XHTML ready for output * @return string XHTML ready for output
*/ */
function referencesFormat( $group ) { function referencesFormat( $group ) {
if ( ( count( $this->mRefs ) == 0 ) or ( empty( $this->mRefs[$group] ) ) ) { if ( ( count( $this->mRefs ) == 0 ) || ( empty( $this->mRefs[$group] ) ) ) {
return ''; return '';
} }

View file

@ -1,8 +1,6 @@
<?php <?php
if ( !defined( 'MEDIAWIKI' ) ) die(); if ( !defined( 'MEDIAWIKI' ) ) die();
global $wgContLang, $wgContLanguageCode, $wgCiteDefaultText;
$dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR; $dir = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
$code = $wgContLang->lc( $wgContLanguageCode ); $code = $wgContLang->lc( $wgContLanguageCode );
$file = file_exists( "${dir}cite_text-$code" ) ? "${dir}cite_text-$code" : "${dir}cite_text"; $file = file_exists( "${dir}cite_text-$code" ) ? "${dir}cite_text-$code" : "${dir}cite_text";