r81489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81488‎ | r81489 | r81490 >
Date:21:40, 3 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Add some braces, fixup some indenting
Modified paths:
  • /trunk/extensions/Cite/Cite_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/Cite_body.php
@@ -633,45 +633,43 @@
634634 */
635635 function referencesFormatEntry( $key, $val ) {
636636 // Anonymous reference
637 - if ( ! is_array( $val ) )
638 - return
639 - wfMsgForContentNoTrans(
 637+ if ( !is_array( $val ) ) {
 638+ return wfMsgForContentNoTrans(
640639 'cite_references_link_one',
641640 $this->referencesKey( $key ),
642641 $this->refKey( $key ),
643642 $val
644643 );
645 - else if ( isset( $val['follow'] ) )
646 - return
647 - wfMsgForContentNoTrans(
 644+ } else if ( isset( $val['follow'] ) ) {
 645+ return wfMsgForContentNoTrans(
648646 'cite_references_no_link',
649647 $this->referencesKey( $val['follow'] ),
650648 $val['text']
651649 );
652 - else if ( $val['text'] == '' ) return
653 - wfMsgForContentNoTrans(
 650+ } else if ( $val['text'] == '' ) {
 651+ return wfMsgForContentNoTrans(
 652+ 'cite_references_link_one',
 653+ $this->referencesKey( $key ),
 654+ $this->refKey( $key, $val['count'] ),
 655+ $this->error( 'cite_error_references_no_text', $key )
 656+ );
 657+ }
 658+
 659+ if ( $val['count'] < 0 ) {
 660+ return wfMsgForContentNoTrans(
654661 'cite_references_link_one',
655 - $this->referencesKey( $key ),
656 - $this->refKey( $key, $val['count'] ),
657 - $this->error( 'cite_error_references_no_text', $key )
658 - );
659 - if ( $val['count'] < 0 )
660 - return
661 - wfMsgForContentNoTrans(
662 - 'cite_references_link_one',
663662 $this->referencesKey( $val['key'] ),
664663 # $this->refKey( $val['key'], $val['count'] ),
665664 $this->refKey( $val['key'] ),
666665
667666 ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
668667 );
669 - // Standalone named reference, I want to format this like an
670 - // anonymous reference because displaying "1. 1.1 Ref text" is
671 - // overkill and users frequently use named references when they
672 - // don't need them for convenience
673 - else if ( $val['count'] === 0 )
674 - return
675 - wfMsgForContentNoTrans(
 668+ // Standalone named reference, I want to format this like an
 669+ // anonymous reference because displaying "1. 1.1 Ref text" is
 670+ // overkill and users frequently use named references when they
 671+ // don't need them for convenience
 672+ } else if ( $val['count'] === 0 ) {
 673+ return wfMsgForContentNoTrans(
676674 'cite_references_link_one',
677675 $this->referencesKey( $key . "-" . $val['key'] ),
678676 # $this->refKey( $key, $val['count'] ),
@@ -679,9 +677,9 @@
680678 ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )
681679 );
682680 // Named references with >1 occurrences
683 - else {
 681+ } else {
684682 $links = array();
685 - // for group handling, we have an extra key here.
 683+ // for group handling, we have an extra key here.
686684 for ( $i = 0; $i <= $val['count']; ++$i ) {
687685 $links[] = wfMsgForContentNoTrans(
688686 'cite_references_link_many_format',
@@ -693,8 +691,7 @@
694692
695693 $list = $this->listToText( $links );
696694
697 - return
698 - wfMsgForContentNoTrans( 'cite_references_link_many',
 695+ return wfMsgForContentNoTrans( 'cite_references_link_many',
699696 $this->referencesKey( $key . "-" . $val['key'] ),
700697 $list,
701698 ( $val['text'] != '' ? $val['text'] : $this->error( 'cite_error_references_no_text', $key ) )

Status & tagging log