Skip to content

Commit

Permalink
Merge pull request #5 from aloware/aloware_specific_changes
Browse files Browse the repository at this point in the history
Unit tests fixes
  • Loading branch information
SohrabZ authored Jul 11, 2024
2 parents ca82a7f + 947edb9 commit 1233ee1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/JobPayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public function __construct($value)

$this->decoded = json_decode($value, true);

$this->job = unserialize($this->command());
$command = $this->command();

if (!empty($command)) {
$this->job = unserialize($command);
}
}

/**
Expand Down Expand Up @@ -84,7 +88,8 @@ public function tags()
*/
public function isFairSignal()
{
return $this->job instanceof \Aloware\FairQueue\FairSignalJob;
return class_exists('\Aloware\FairQueue\FairSignalJob')
&& $this->job instanceof \Aloware\FairQueue\FairSignalJob;
}

/**
Expand Down

0 comments on commit 1233ee1

Please sign in to comment.