X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fprotect.php;h=31b2101c685bb405b5c48e0de47571ff8903d689;hb=fd88074bbf78e7113dee6eec627c858f3c4fc01d;hp=449a7ad6f0bf9812616881417398002147ec81de;hpb=ea9fcc1e4d3b572199d82c426024e3e5efe23879;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/protect.php b/maintenance/protect.php index 449a7ad6f0..31b2101c68 100644 --- a/maintenance/protect.php +++ b/maintenance/protect.php @@ -31,7 +31,7 @@ require_once __DIR__ . '/Maintenance.php'; class Protect extends Maintenance { public function __construct() { parent::__construct(); - $this->mDescription = "Protect or unprotect a page from the command line."; + $this->addDescription( 'Protect or unprotect a page from the command line.' ); $this->addOption( 'unprotect', 'Removes protection' ); $this->addOption( 'semiprotect', 'Adds semi-protection' ); $this->addOption( 'cascade', 'Add cascading protection' ); @@ -54,7 +54,7 @@ class Protect extends Maintenance { } if ( $userName === false ) { - $user = User::newSystemUser( 'Maintenance script', array( 'steal' => true ) ); + $user = User::newSystemUser( 'Maintenance script', [ 'steal' => true ] ); } else { $user = User::newFromName( $userName ); } @@ -63,14 +63,14 @@ class Protect extends Maintenance { } // @todo FIXME: This is reset 7 lines down. - $restrictions = array( 'edit' => $protection, 'move' => $protection ); + $restrictions = [ 'edit' => $protection, 'move' => $protection ]; $t = Title::newFromText( $this->getArg() ); if ( !$t ) { $this->error( "Invalid title", true ); } - $restrictions = array(); + $restrictions = []; foreach ( $t->getRestrictionTypes() as $type ) { $restrictions[$type] = $protection; } @@ -79,7 +79,7 @@ class Protect extends Maintenance { $this->output( "Updating protection status... " ); $page = WikiPage::factory( $t ); - $status = $page->doUpdateRestrictions( $restrictions, array(), $cascade, $reason, $user ); + $status = $page->doUpdateRestrictions( $restrictions, [], $cascade, $reason, $user ); if ( $status->isOK() ) { $this->output( "done\n" );