r108867 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108866‎ | r108867 | r108868 >
Date:22:45, 13 January 2012
Author:reedy
Status:ok
Tags:
Comment:
Minor stylistic changes

Don't attempt to return values returned by void methods

Kill freeResult

Minor documentation
Modified paths:
  • /trunk/extensions/Nuke/Nuke_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Nuke/Nuke_body.php
@@ -7,7 +7,6 @@
88 }
99
1010 public function execute( $par ) {
11 -
1211 if( !$this->userCanExecute( $this->getUser() ) ) {
1312 $this->displayRestrictionError();
1413 return;
@@ -39,20 +38,17 @@
4039 $pages = $req->getArray( 'pages' );
4140
4241 if( $pages ) {
43 - return $this->doDelete( $pages, $reason );
 42+ $this->doDelete( $pages, $reason );
 43+ return;
4444 }
45 - }
46 - elseif ( $req->getVal( 'action' ) == 'submit' ) {
 45+ } elseif ( $req->getVal( 'action' ) == 'submit' ) {
4746 $this->listForm( $target, $reason, $req->getInt( 'limit', 500 ) );
48 - }
49 - else {
 47+ } else {
5048 $this->promptForm();
5149 }
52 - }
53 - elseif ( $target === '' ) {
 50+ } elseif ( $target === '' ) {
5451 $this->promptForm();
55 - }
56 - else {
 52+ } else {
5753 $this->listForm( $target, $reason, $req->getInt( 'limit', 500 ) );
5854 }
5955 }
@@ -108,12 +104,12 @@
109105 if( count( $pages ) == 0 ) {
110106 if ( $username === '' ) {
111107 $out->addWikiMsg( 'nuke-nopages-global' );
112 - }
113 - else {
 108+ } else {
114109 $out->addWikiMsg( 'nuke-nopages', $username );
115110 }
116111
117 - return $this->promptForm( $username );
 112+ $this->promptForm( $username );
 113+ return;
118114 }
119115
120116 if ( $username === '' ) {
@@ -162,6 +158,9 @@
163159 $out->addHTML( '<ul>' );
164160
165161 foreach( $pages as $info ) {
 162+ /**
 163+ * @var $title title
 164+ */
166165 list( $title, $edits, $userName ) = $info;
167166
168167 $image = $title->getNamespace() == NS_IMAGE ? wfLocalFile( $title ) : false;
@@ -253,8 +252,6 @@
254253 $resultEdits->numRows(),
255254 $username == '' ? $row->rc_user_text : false
256255 );
257 -
258 - $dbr->freeResult( $resultEdits );
259256 }
260257
261258 return $pages;

Status & tagging log