Merge "Localisation updates from https://translatewiki.net."
[lhc/web/wiklou.git] / includes / jobqueue / Job.php
index 22ff446..060003b 100644 (file)
@@ -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();
                }