Cleaned up various revisiondelete IDE warnings

Change-Id: I4750eabf9985785520aaac8eca12d488ca746966
This commit is contained in:
Aaron Schulz 2015-05-22 11:18:12 -07:00 committed by Umherirrender
parent 016fd0b776
commit 4161843d87
5 changed files with 12 additions and 9 deletions

View file

@ -36,6 +36,8 @@ abstract class RevDelItem extends RevisionItemBase {
/**
* Get the current deletion bitfield value
*
* @return integer
*/
abstract public function getBits();

View file

@ -78,7 +78,7 @@ abstract class RevDelList extends RevisionListBase {
* transactions are done here.
*
* @param array $params Associative array of parameters. Members are:
* value: The integer value to set the visibility to
* value: ExtractBitParams() bitfield array
* comment: The log comment.
* perItemStatus: Set if you want per-item status reports
* @return Status
@ -109,6 +109,7 @@ abstract class RevDelList extends RevisionListBase {
// @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $this->reset(); $this->current(); $this->next() ) {
// @codingStandardsIgnoreEnd
/** @var $item RevDelItem */
$item = $this->current();
unset( $missing[$item->getId()] );
@ -200,6 +201,7 @@ abstract class RevDelList extends RevisionListBase {
}
// Log it
// @FIXME: $newBits/$oldBits set in for loop, makes IDE warnings too
$this->updateLog( array(
'title' => $this->title,
'count' => $successCount,

View file

@ -48,7 +48,7 @@ class RevDelLogItem extends RevDelItem {
}
public function getBits() {
return $this->row->log_deleted;
return (int)$this->row->log_deleted;
}
public function setBits( $bits ) {

View file

@ -233,9 +233,9 @@ class RevisionDeleter {
* @since 1.22
* @param array $bitPars ExtractBitParams() params
* @param int $oldfield Current bitfield
* @return array
* @return integer
*/
public static function extractBitfield( $bitPars, $oldfield ) {
public static function extractBitfield( array $bitPars, $oldfield ) {
// Build the actual new rev_deleted bitfield
$newBits = 0;
foreach ( $bitPars as $const => $val ) {

View file

@ -585,7 +585,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
throw new PermissionsError( 'suppressrevision' );
}
# If the save went through, go to success message...
$status = $this->save( $bitParams, $comment, $this->targetObj );
$status = $this->save( $bitParams, $comment );
if ( $status->isGood() ) {
$this->success();
@ -651,14 +651,13 @@ class SpecialRevisionDelete extends UnlistedSpecialPage {
/**
* Do the write operations. Simple wrapper for RevDel*List::setVisibility().
* @param int $bitfield
* @param array $bitPars ExtractBitParams() bitfield array
* @param string $reason
* @param Title $title
* @return Status
*/
protected function save( $bitfield, $reason, $title ) {
protected function save( array $bitPars, $reason ) {
return $this->getList()->setVisibility(
array( 'value' => $bitfield, 'comment' => $reason )
array( 'value' => $bitPars, 'comment' => $reason )
);
}