$interval = $this->getOption( 'i', 0 );
if ( $username === false ) {
- $user = User::newSystemUser( 'Delete page script', array( 'steal' => true ) );
+ $user = User::newSystemUser( 'Delete page script', [ 'steal' => true ] );
} else {
$user = User::newFromName( $username );
}
if ( !$user ) {
- $this->error( "Invalid username", true );
+ $this->fatalError( "Invalid username" );
}
$wgUser = $user;
# Setup
if ( !$file ) {
- $this->error( "Unable to read file, exiting", true );
+ $this->fatalError( "Unable to read file, exiting" );
}
$dbw = $this->getDB( DB_MASTER );
# Handle each entry
- // @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed
+ // phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
for ( $linenum = 1; !feof( $file ); $linenum++ ) {
- // @codingStandardsIgnoreEnd
$line = trim( fgets( $file ) );
if ( $line == '' ) {
continue;
$this->output( $title->getPrefixedText() );
if ( $title->getNamespace() == NS_FILE ) {
- $img = wfFindFile( $title, array( 'ignoreRedirect' => true ) );
+ $img = wfFindFile( $title, [ 'ignoreRedirect' => true ] );
if ( $img && $img->isLocal() && !$img->delete( $reason ) ) {
$this->output( " FAILED to delete associated file... " );
}
}
}
-$maintClass = "DeleteBatch";
+$maintClass = DeleteBatch::class;
require_once RUN_MAINTENANCE_IF_MAIN;