Skip to content

Commit

Permalink
Merge pull request #292 from php-enqueue/job-queue-change-typehint
Browse files Browse the repository at this point in the history
[job-queue] Change typehint, allow not only Closure but other callabl…
  • Loading branch information
makasim authored Dec 14, 2017
2 parents 901c2c5 + b8a3426 commit 3291f67
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/job-queue/JobRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function __construct(JobProcessor $jobProcessor, Job $rootJob = null)
/**
* @param string $ownerId
* @param string $name
* @param \Closure $runCallback
* @param callable $runCallback
*
* @return mixed
*/
public function runUnique($ownerId, $name, \Closure $runCallback)
public function runUnique($ownerId, $name, callable $runCallback)
{
$rootJob = $this->jobProcessor->findOrCreateRootJob($ownerId, $name, true);
if (!$rootJob) {
Expand Down Expand Up @@ -59,11 +59,11 @@ public function runUnique($ownerId, $name, \Closure $runCallback)

/**
* @param string $name
* @param \Closure $startCallback
* @param callable $startCallback
*
* @return mixed
*/
public function createDelayed($name, \Closure $startCallback)
public function createDelayed($name, callable $startCallback)
{
$childJob = $this->jobProcessor->findOrCreateChildJob($name, $this->rootJob);

Expand All @@ -74,11 +74,11 @@ public function createDelayed($name, \Closure $startCallback)

/**
* @param string $jobId
* @param \Closure $runCallback
* @param callable $runCallback
*
* @return mixed
*/
public function runDelayed($jobId, \Closure $runCallback)
public function runDelayed($jobId, callable $runCallback)
{
$job = $this->jobProcessor->findJobById($jobId);
if (!$job) {
Expand Down

0 comments on commit 3291f67

Please sign in to comment.