55use Resque \Job \PID ;
66use Resque \Job \Status ;
77use Resque \Exceptions \DoNotPerformException ;
8+ use Resque \Exceptions \ResqueException ;
89use Resque \Job \FactoryInterface ;
910use Resque \Job \Factory ;
1011use Resque \Job \Job ;
@@ -25,7 +26,7 @@ class JobHandler
2526public $ queue ;
2627
2728/**
28- * @var \Resque\Worker\Resque Instance of the Resque worker running this job.
29+ * @var \Resque\Worker\ResqueWorker Instance of the Resque worker running this job.
2930 */
3031public $ worker ;
3132
@@ -50,7 +51,7 @@ class JobHandler
5051public $ endTime ;
5152
5253/**
53- * @var Job Instance of the class performing work for this job.
54+ * @var Job|null Instance of the class performing work for this job.
5455 */
5556private $ instance ;
5657
@@ -67,6 +68,7 @@ class JobHandler
6768 */
6869public function __construct ($ queue ,$ payload )
6970{
71+ $ this ->instance =null ;
7072$ this ->queue =$ queue ;
7173$ this ->payload =$ payload ;
7274$ this ->popTime =microtime (true );
@@ -79,12 +81,12 @@ public function __construct($queue, $payload)
7981/**
8082 * Create a new job and save it to the specified queue.
8183 *
82- * @param string $queue The name of the queue to place the job in.
83- * @param string $class The name of the class that contains the code to execute the job.
84- * @param array $args Any optional arguments that should be passed when the job is executed.
85- * @param boolean $monitor Set to true to be able to monitor the status of a job.
86- * @param string $id Unique identifier for tracking the job. Generated if not supplied.
87- * @param string $prefix The prefix needs to be set for the status key
84+ * @param string $queue The name of the queue to place the job in.
85+ * @paramclass- string $class The name of the class that contains the code to execute the job.
86+ * @param array $args Any optional arguments that should be passed when the job is executed.
87+ * @param boolean $monitor Set to true to be able to monitor the status of a job.
88+ * @param string $id Unique identifier for tracking the job. Generated if not supplied.
89+ * @param string $prefix The prefix needs to be set for the status key
8890 *
8991 * @return string
9092 */
@@ -201,7 +203,8 @@ public function getInstance(): Job
201203return $ this ->instance ;
202204}
203205
204- $ this ->instance =$ this ->getJobFactory ()->create ($ this ->payload ['class ' ],$ this ->getArguments (),$ this ->queue );
206+ $ this ->instance =$ this ->getJobFactory ()
207+ ->create ($ this ->payload ['class ' ],$ this ->getArguments (),$ this ->queue );
205208$ this ->instance ->job =$ this ;
206209$ this ->instance ->jobID =$ this ->payload ['id ' ];
207210return $ this ->instance ;
@@ -211,8 +214,8 @@ public function getInstance(): Job
211214 * Actually execute a job by calling the perform method on the class
212215 * associated with the job with the supplied arguments.
213216 *
214- * @returnmixed
215- * @throwsResque\Exceptions\ ResqueException When the job's class could not be found.
217+ * @returnbool
218+ * @throws ResqueException When the job's class could not be found.
216219 */
217220public function perform ()
218221{
@@ -325,8 +328,8 @@ public function __toString()
325328}
326329
327330/**
328- * @param Resque\Job\FactoryInterface $jobFactory
329- * @return Resque\JobHandler
331+ * @param\ Resque\Job\FactoryInterface $jobFactory
332+ * @return\ Resque\JobHandler
330333 */
331334public function setJobFactory (FactoryInterface $ jobFactory )
332335{
@@ -336,7 +339,7 @@ public function setJobFactory(FactoryInterface $jobFactory)
336339}
337340
338341/**
339- * @return Resque\Job\FactoryInterface
342+ * @return\ Resque\Job\FactoryInterface
340343 */
341344public function getJobFactory ():FactoryInterface
342345{