X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=maintenance%2FshowJobs.php;h=b2fde8ed2a55dc39fa9c6912359181a8a19e9e66;hp=25a096c04800e5b5e69219c61c293367d82383b6;hb=11ee7f78da9776db26098642a151a288f98bea14;hpb=cb2896f90ebef77c02c9da4067b0e56e37471092 diff --git a/maintenance/showJobs.php b/maintenance/showJobs.php index 25a096c048..b2fde8ed2a 100644 --- a/maintenance/showJobs.php +++ b/maintenance/showJobs.php @@ -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;