X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJobQueue.php;h=5b7193856d9dc7308591d6e6201e42f4a9a1ffc4;hb=3b17287bb8d5ce18fa363c3d7c549323603541e9;hp=69a3defbc118e591ab4780c0cfcc15e028673d0b;hpb=ca56f1fbc32529622cf430fe2ed44347b85e3c24;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php index 69a3defbc1..5b7193856d 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -73,7 +73,7 @@ abstract class JobQueue { $this->dupCache = wfGetCache( CACHE_ANYTHING ); $this->aggr = isset( $params['aggregator'] ) ? $params['aggregator'] - : new JobQueueAggregatorNull( array() ); + : new JobQueueAggregatorNull( [] ); } /** @@ -286,13 +286,13 @@ abstract class JobQueue { * This does not require $wgJobClasses to be set for the given job type. * Outside callers should use JobQueueGroup::push() instead of this function. * - * @param JobSpecification|JobSpecification[] $jobs + * @param IJobSpecification|IJobSpecification[] $jobs * @param int $flags Bitfield (supports JobQueue::QOS_ATOMIC) * @return void * @throws JobQueueError */ final public function push( $jobs, $flags = 0 ) { - $jobs = is_array( $jobs ) ? $jobs : array( $jobs ); + $jobs = is_array( $jobs ) ? $jobs : [ $jobs ]; $this->batchPush( $jobs, $flags ); } @@ -301,7 +301,7 @@ abstract class JobQueue { * This does not require $wgJobClasses to be set for the given job type. * Outside callers should use JobQueueGroup::push() instead of this function. * - * @param JobSpecification[] $jobs + * @param IJobSpecification[] $jobs * @param int $flags Bitfield (supports JobQueue::QOS_ATOMIC) * @return void * @throws MWException @@ -333,7 +333,7 @@ abstract class JobQueue { /** * @see JobQueue::batchPush() - * @param JobSpecification[] $jobs + * @param IJobSpecification[] $jobs * @param int $flags */ abstract protected function doBatchPush( array $jobs, $flags ); @@ -377,7 +377,7 @@ abstract class JobQueue { /** * @see JobQueue::pop() - * @return Job + * @return Job|bool */ abstract protected function doPop(); @@ -589,7 +589,7 @@ abstract class JobQueue { * @since 1.22 */ public function getAllDelayedJobs() { - return new ArrayIterator( array() ); // not implemented + return new ArrayIterator( [] ); // not implemented } /** @@ -603,7 +603,7 @@ abstract class JobQueue { * @since 1.26 */ public function getAllAcquiredJobs() { - return new ArrayIterator( array() ); // not implemented + return new ArrayIterator( [] ); // not implemented } /** @@ -614,7 +614,7 @@ abstract class JobQueue { * @since 1.25 */ public function getAllAbandonedJobs() { - return new ArrayIterator( array() ); // not implemented + return new ArrayIterator( [] ); // not implemented } /** @@ -688,17 +688,6 @@ abstract class JobQueue { $stats->updateCount( "jobqueue.{$key}.all", $delta ); $stats->updateCount( "jobqueue.{$key}.{$type}", $delta ); } - - /** - * Namespace the queue with a key to isolate it for testing - * - * @param string $key - * @return void - * @throws MWException - */ - public function setTestingPrefix( $key ) { - throw new MWException( "Queue namespacing not supported for this queue type." ); - } } /**