Skip to content

Commit

Permalink
replace is_object with is_array when reserving jobs since Resque::pop…
Browse files Browse the repository at this point in the history
… actually returns an array instead of an object
  • Loading branch information
Salimane Adjao Moustapha committed Dec 8, 2011
1 parent cd47df2 commit 458fd64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/Resque.php
Expand Up @@ -73,7 +73,7 @@ public static function push($queue, $item)
* 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)
{
Expand Down Expand Up @@ -113,7 +113,7 @@ public static function enqueue($queue, $class, $args = null, $trackStatus = fals
'args' => $args,
));
}

return $result;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Resque/Job.php
Expand Up @@ -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)
{
Expand Down Expand Up @@ -84,7 +84,7 @@ public static function create($queue, $class, $args = null, $monitor = false)
public static function reserve($queue)
{
$payload = Resque::pop($queue);
if(!is_object($payload)) {
if(!is_array($payload)) {
return false;
}

Expand Down

0 comments on commit 458fd64

Please sign in to comment.