X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJob.php;h=d624acf97fbe9ca614955f5c131bdcdf8424d844;hb=f8337198ce21896d2d22123e006dbc9e2973c3a0;hp=f9c416f3af700637df6e98fc8ba95555e8e7f214;hpb=b1b0070dc7557311cc38e7cc99e4231ac4b92940;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index f9c416f3af..d624acf97f 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -23,8 +23,7 @@ /** * Class to both describe a background job and handle jobs. - * The queue aspects of this class are now deprecated. - * Using the class to push jobs onto queues is deprecated (use JobSpecification). + * To push jobs onto queues, use JobQueueGroup::singleton()->push(); * * @ingroup JobQueue */ @@ -68,7 +67,7 @@ abstract class Job implements IJobSpecification { * @param string $command Job command * @param Title $title Associated title * @param array $params Job parameters - * @throws MWException + * @throws InvalidArgumentException * @return Job */ public static function factory( $command, Title $title, $params = [] ) { @@ -123,23 +122,6 @@ abstract class Job implements IJobSpecification { return ( $this->executionFlags && $flag ) === $flag; } - /** - * Batch-insert a group of jobs into the queue. - * This will be wrapped in a transaction with a forced commit. - * - * This may add duplicate at insert time, but they will be - * removed later on, when the first one is popped. - * - * @param Job[] $jobs Array of Job objects - * @return bool - * @deprecated since 1.21 - */ - public static function batchInsert( $jobs ) { - wfDeprecated( __METHOD__, '1.21' ); - JobQueueGroup::singleton()->push( $jobs ); - return true; - } - /** * @return string */ @@ -188,9 +170,7 @@ abstract class Job implements IJobSpecification { * @since 1.27 */ public function getRequestId() { - return isset( $this->params['requestId'] ) - ? $this->params['requestId'] - : null; + return $this->params['requestId'] ?? null; } /** @@ -298,12 +278,8 @@ abstract class Job implements IJobSpecification { */ public function getRootJobParams() { return [ - 'rootJobSignature' => isset( $this->params['rootJobSignature'] ) - ? $this->params['rootJobSignature'] - : null, - 'rootJobTimestamp' => isset( $this->params['rootJobTimestamp'] ) - ? $this->params['rootJobTimestamp'] - : null + 'rootJobSignature' => $this->params['rootJobSignature'] ?? null, + 'rootJobTimestamp' => $this->params['rootJobTimestamp'] ?? null ]; } @@ -346,17 +322,6 @@ abstract class Job implements IJobSpecification { } } - /** - * Insert a single job into the queue. - * @return bool True on success - * @deprecated since 1.21 - */ - public function insert() { - wfDeprecated( __METHOD__, '1.21' ); - JobQueueGroup::singleton()->push( $this ); - return true; - } - /** * @return string */