X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fjobqueue%2FJob.php;h=060003b2ec4b6b3a27e79a8f0545e58b23e7a07f;hb=8df94abddc79f35404a17412abf42b45987a0a25;hp=22ff4468dd540833a9590c1d7a723c124d290b51;hpb=3222ddcea8eb4364efb358eddb94657cc86989de;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/jobqueue/Job.php b/includes/jobqueue/Job.php index 22ff4468dd..060003b2ec 100644 --- a/includes/jobqueue/Job.php +++ b/includes/jobqueue/Job.php @@ -65,7 +65,7 @@ abstract class Job implements IJobSpecification { * Create the appropriate object to handle a specific job * * @param string $command Job command - * @param array $params Job parameters + * @param array|Title $params Job parameters * @throws InvalidArgumentException * @return Job */ @@ -106,13 +106,13 @@ abstract class Job implements IJobSpecification { /** * @param string $command - * @param array $params + * @param array|Title|null $params */ - public function __construct( $command, $params = [] ) { + public function __construct( $command, $params = null ) { if ( $params instanceof Title ) { // Backwards compatibility for old signature ($command, $title, $params) $title = $params; - $params = func_num_args() >= 3 ? func_get_arg( 2 ) : []; + $params = func_get_arg( 2 ); } else { // Subclasses can override getTitle() to return something more meaningful $title = Title::makeTitle( NS_SPECIAL, 'Blankpage' ); @@ -120,7 +120,7 @@ abstract class Job implements IJobSpecification { $this->command = $command; $this->title = $title; - $this->params = is_array( $params ) ? $params : []; // sanity + $this->params = is_array( $params ) ? $params : []; if ( !isset( $this->params['requestId'] ) ) { $this->params['requestId'] = WebRequest::getRequestId(); }