/**
* Get the current deletion bitfield value
+ *
+ * @return integer
*/
abstract public function getBits();
* 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
// @codingStandardsIgnoreStart Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
for ( $this->reset(); $this->current(); $this->next() ) {
// @codingStandardsIgnoreEnd
+ /** @var $item RevDelItem */
$item = $this->current();
unset( $missing[$item->getId()] );
}
// Log it
+ // @FIXME: $newBits/$oldBits set in for loop, makes IDE warnings too
$this->updateLog( array(
'title' => $this->title,
'count' => $successCount,
}
public function getBits() {
- return $this->row->log_deleted;
+ return (int)$this->row->log_deleted;
}
public function setBits( $bits ) {
* @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 ) {
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();
/**
* 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 )
);
}