From 458fd6488b1db90623d737ef8b40801a039ce664 Mon Sep 17 00:00:00 2001 From: Salimane Adjao Moustapha Date: Thu, 8 Dec 2011 11:15:46 +0800 Subject: [PATCH 1/2] replace is_object with is_array when reserving jobs since Resque::pop actually returns an array instead of an object --- lib/Resque.php | 4 ++-- lib/Resque/Job.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Resque.php b/lib/Resque.php index d429ae5..c5fe038 100644 --- a/lib/Resque.php +++ b/lib/Resque.php @@ -73,7 +73,7 @@ class Resque * return it. * * @param string $queue The name of the queue to fetch an item from. - * @return object Decoded item from the queue. + * @return array Decoded item from the queue. */ public static function pop($queue) { @@ -113,7 +113,7 @@ class Resque 'args' => $args, )); } - + return $result; } diff --git a/lib/Resque/Job.php b/lib/Resque/Job.php index 257a3a3..654271a 100644 --- a/lib/Resque/Job.php +++ b/lib/Resque/Job.php @@ -37,7 +37,7 @@ class Resque_Job * Instantiate a new instance of a job. * * @param string $queue The queue that the job belongs to. - * @param object $payload Object containing details of the job. + * @param array $payload array containing details of the job. */ public function __construct($queue, $payload) { @@ -84,7 +84,7 @@ class Resque_Job public static function reserve($queue) { $payload = Resque::pop($queue); - if(!is_object($payload)) { + if(!is_array($payload)) { return false; } From 7a7cfbf2b9122e8958d2d3a881764eecee44c751 Mon Sep 17 00:00:00 2001 From: Salimane Adjao Moustapha Date: Fri, 16 Dec 2011 10:30:42 +0800 Subject: [PATCH 2/2] fix comment to specify that is an array instead of an object in Resque::push --- lib/Resque.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Resque.php b/lib/Resque.php index c5fe038..d0be465 100644 --- a/lib/Resque.php +++ b/lib/Resque.php @@ -60,7 +60,7 @@ class Resque * exist, then create it as well. * * @param string $queue The name of the queue to add the job to. - * @param object $item Job description as an object to be JSON encoded. + * @param array $item Job description as an array to be JSON encoded. */ public static function push($queue, $item) {