From b8a3426302b779dd70216a704eec8cccbeacf976 Mon Sep 17 00:00:00 2001 From: Maksim Kotlyar Date: Thu, 14 Dec 2017 15:36:17 +0200 Subject: [PATCH] [job-queue] Change typehint, allow not only Closure but other callables too. --- pkg/job-queue/JobRunner.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/job-queue/JobRunner.php b/pkg/job-queue/JobRunner.php index bfca429a6..c209444b9 100644 --- a/pkg/job-queue/JobRunner.php +++ b/pkg/job-queue/JobRunner.php @@ -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) { @@ -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); @@ -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) {