Don't manually quote stuff
authorReedy <reedy@wikimedia.org>
Thu, 2 Aug 2012 19:36:21 +0000 (20:36 +0100)
committerReedy <reedy@wikimedia.org>
Thu, 2 Aug 2012 19:36:21 +0000 (20:36 +0100)
Minor parameter documentation stuffs

Change-Id: Ie21cbfcf878de4efbf93f1d29900fe9d5f4c7ed2

includes/job/Job.php
maintenance/runJobs.php

index 7b7ec0c..fcf5ca8 100644 (file)
@@ -213,8 +213,9 @@ abstract class Job {
         *
         * @param $command String: Job command
         * @param $title Title: Associated title
-        * @param $params Array: Job parameters
+        * @param $params Array|bool: Job parameters
         * @param $id Int: Job identifier
+        * @throws MWException
         * @return Job
         */
        static function factory( $command, Title $title, $params = false, $id = 0 ) {
@@ -343,8 +344,8 @@ abstract class Job {
        /**
         * @param $command
         * @param $title
-        * @param $params array
-        * @param int $id
+        * @param $params array|bool
+        * @param $id int
         */
        function __construct( $command, $title, $params = false, $id = 0 ) {
                $this->command = $command;
index 9c1ad29..946ee2b 100644 (file)
@@ -60,11 +60,11 @@ class RunJobs extends Maintenance {
                $wgTitle = Title::newFromText( 'RunJobs.php' );
                $dbw = wfGetDB( DB_MASTER );
                $n = 0;
-               $conds = '';
+
                if ( $type === false ) {
                        $conds = Job::defaultQueueConditions( );
                } else {
-                       $conds = "job_cmd = " . $dbw->addQuotes( $type );
+                       $conds = array( 'job_cmd' => $type );
                }
 
                while ( $dbw->selectField( 'job', 'job_id', $conds, 'runJobs.php' ) ) {