@@ -27,7 +27,7 @@ class Resque_Job
27
27
* @var object Object containing details of the job.
28
28
*/
29
29
public $ payload ;
30
-
30
+
31
31
/**
32
32
* @var object Instance of the class performing work for this job.
33
33
*/
@@ -84,7 +84,7 @@ public static function create($queue, $class, $args = null, $monitor = false)
84
84
public static function reserve ($ queue )
85
85
{
86
86
$ payload = Resque::pop ($ queue );
87
- if (!$ payload ) {
87
+ if (!is_object ( $ payload) ) {
88
88
return false ;
89
89
}
90
90
@@ -116,7 +116,7 @@ public function getStatus()
116
116
$ status = new Resque_Job_Status ($ this ->payload ['id ' ]);
117
117
return $ status ->get ();
118
118
}
119
-
119
+
120
120
/**
121
121
* Get the arguments supplied to this job.
122
122
*
@@ -127,10 +127,10 @@ public function getArguments()
127
127
if (!isset ($ this ->payload ['args ' ])) {
128
128
return array ();
129
129
}
130
-
130
+
131
131
return $ this ->payload ['args ' ][0 ];
132
132
}
133
-
133
+
134
134
/**
135
135
* Get the instantiated object for this job that will be performing work.
136
136
*
@@ -171,7 +171,7 @@ public function perform()
171
171
$ instance = $ this ->getInstance ();
172
172
try {
173
173
Resque_Event::trigger ('beforePerform ' , $ this );
174
-
174
+
175
175
if (method_exists ($ instance , 'setUp ' )) {
176
176
$ instance ->setUp ();
177
177
}
@@ -188,7 +188,7 @@ public function perform()
188
188
catch (Resque_Job_DontPerform $ e ) {
189
189
return false ;
190
190
}
191
-
191
+
192
192
return true ;
193
193
}
194
194
0 commit comments