$this->dupCache = wfGetCache( CACHE_ANYTHING );
$this->aggr = isset( $params['aggregator'] )
? $params['aggregator']
- : new JobQueueAggregatorNull( array() );
+ : new JobQueueAggregatorNull( [] );
}
/**
* 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 );
}
* 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
/**
* @see JobQueue::batchPush()
- * @param JobSpecification[] $jobs
+ * @param IJobSpecification[] $jobs
* @param int $flags
*/
abstract protected function doBatchPush( array $jobs, $flags );
/**
* @see JobQueue::pop()
- * @return Job
+ * @return Job|bool
*/
abstract protected function doPop();
* @since 1.22
*/
public function getAllDelayedJobs() {
- return new ArrayIterator( array() ); // not implemented
+ return new ArrayIterator( [] ); // not implemented
}
/**
* @since 1.26
*/
public function getAllAcquiredJobs() {
- return new ArrayIterator( array() ); // not implemented
+ return new ArrayIterator( [] ); // not implemented
}
/**
* @since 1.25
*/
public function getAllAbandonedJobs() {
- return new ArrayIterator( array() ); // not implemented
+ return new ArrayIterator( [] ); // not implemented
}
/**
$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." );
- }
}
/**