protected $type = 'generic';
/** @var bool */
protected $cacheable = false; // does this override getCachedWork() ?
+ /** @var PoolCounter */
+ private $poolCounter;
/**
- * @param string $type The type of PoolCounter to use
+ * @param string $type The class of actions to limit concurrency for (task type)
* @param string $key Key that identifies the queue this work is placed on
*/
public function __construct( $type, $key ) {
/**
* Do something with the error, like showing it to the user.
*
- * @param $status
+ * @param Status $status
*
* @return bool
*/
/* These two cases should never be hit... */
case PoolCounter::ERROR:
default:
- $errors = array(
+ $errors = [
PoolCounter::QUEUE_FULL => 'pool-queuefull',
- PoolCounter::TIMEOUT => 'pool-timeout' );
+ PoolCounter::TIMEOUT => 'pool-timeout' ];
- $status = Status::newFatal( isset( $errors[$status->value] )
- ? $errors[$status->value]
- : 'pool-errorunknown' );
+ $status = Status::newFatal( $errors[$status->value] ?? 'pool-errorunknown' );
$this->logError( $status );
return $this->error( $status );
}