Skip to content

Commit 7bb67e2

Browse files
committed
make a few tweaks
1 parent 0a9d6d0 commit 7bb67e2

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

Diff for: src/Illuminate/Console/Scheduling/Schedule.php

+13-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Illuminate\Console\Application;
66
use Illuminate\Container\Container;
7-
use Illuminate\Contracts\Queue\ShouldQueue;
87
use Symfony\Component\Process\ProcessUtils;
98
use Illuminate\Contracts\Cache\Repository as Cache;
109

@@ -49,19 +48,6 @@ public function call($callback, array $parameters = [])
4948
return $event;
5049
}
5150

52-
/**
53-
* Add a new queued job callback event to the schedule.
54-
*
55-
* @param \Illuminate\Contracts\Queue\ShouldQueue $job
56-
* @return \Illuminate\Console\Scheduling\Event
57-
*/
58-
public function job(ShouldQueue $job)
59-
{
60-
return $this->call(function () use ($job) {
61-
dispatch($job);
62-
})->name(get_class($job));
63-
}
64-
6551
/**
6652
* Add a new Artisan command event to the schedule.
6753
*
@@ -80,6 +66,19 @@ public function command($command, array $parameters = [])
8066
);
8167
}
8268

69+
/**
70+
* Add a new job callback event to the schedule.
71+
*
72+
* @param object|string $job
73+
* @return \Illuminate\Console\Scheduling\Event
74+
*/
75+
public function job($job)
76+
{
77+
return $this->call(function () use ($job) {
78+
dispatch(is_string($job) ? resolve($job) : $job);
79+
})->name(is_string($job) ? $job : get_class($job));
80+
}
81+
8382
/**
8483
* Add a new command event to the schedule.
8584
*

0 commit comments

Comments
 (0)