Merge "mw.Feedback: If the message is posted remotely, link the title correctly"
[lhc/web/wiklou.git] / maintenance / showJobs.php
index 25a096c..b2fde8e 100644 (file)
@@ -34,16 +34,16 @@ require_once __DIR__ . '/Maintenance.php';
  * @ingroup Maintenance
  */
 class ShowJobs extends Maintenance {
-       protected static $stateMethods = array(
+       protected static $stateMethods = [
                'unclaimed' => 'getAllQueuedJobs',
                'delayed'   => 'getAllDelayedJobs',
                'claimed'   => 'getAllAcquiredJobs',
                'abandoned' => 'getAllAbandonedJobs',
-       );
+       ];
 
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Show number of jobs waiting in master database";
+               $this->addDescription( 'Show number of jobs waiting in master database' );
                $this->addOption( 'group', 'Show number of jobs per job type' );
                $this->addOption( 'list', 'Show a list of all jobs instead of counts' );
                $this->addOption( 'type', 'Only show/count jobs of a given type', false, true );
@@ -59,10 +59,10 @@ class ShowJobs extends Maintenance {
                $group = JobQueueGroup::singleton();
 
                $filteredTypes = $typeFilter
-                       ? array( $typeFilter )
+                       ? [ $typeFilter ]
                        : $group->getQueueTypes();
                $filteredStates = $stateFilter
-                       ? array_intersect_key( self::$stateMethods, array( $stateFilter => 1 ) )
+                       ? array_intersect_key( self::$stateMethods, [ $stateFilter => 1 ] )
                        : self::$stateMethods;
 
                if ( $this->hasOption( 'list' ) ) {
@@ -105,5 +105,5 @@ class ShowJobs extends Maintenance {
        }
 }
 
-$maintClass = "ShowJobs";
+$maintClass = ShowJobs::class;
 require_once RUN_MAINTENANCE_IF_MAIN;