X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FdeleteBatch.php;h=c3cbdebcdf9bb5954c5f6c84545714230cc3766c;hb=ad6a6baa1d35e1b05b973fbebad4962fe190172d;hp=e8839c593e2b25ff0cca5800899378cae68feced;hpb=829b2e7d0169ba977cec42df6ee83eb60de51045;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php index e8839c593e..c3cbdebcdf 100644 --- a/maintenance/deleteBatch.php +++ b/maintenance/deleteBatch.php @@ -60,12 +60,12 @@ class DeleteBatch extends Maintenance { $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; @@ -77,15 +77,14 @@ class DeleteBatch extends Maintenance { # 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; @@ -102,7 +101,7 @@ class DeleteBatch extends Maintenance { $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... " ); }