Skip to content

Commit

Permalink
make a few tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Mar 7, 2017
1 parent 0a9d6d0 commit 7bb67e2
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions src/Illuminate/Console/Scheduling/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Console\Application;
use Illuminate\Container\Container;
use Illuminate\Contracts\Queue\ShouldQueue;
use Symfony\Component\Process\ProcessUtils;
use Illuminate\Contracts\Cache\Repository as Cache;

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

/**
* Add a new queued job callback event to the schedule.
*
* @param \Illuminate\Contracts\Queue\ShouldQueue $job
* @return \Illuminate\Console\Scheduling\Event
*/
public function job(ShouldQueue $job)
{
return $this->call(function () use ($job) {
dispatch($job);
})->name(get_class($job));
}

/**
* Add a new Artisan command event to the schedule.
*
Expand All @@ -80,6 +66,19 @@ public function command($command, array $parameters = [])
);
}

/**
* Add a new job callback event to the schedule.
*
* @param object|string $job
* @return \Illuminate\Console\Scheduling\Event
*/
public function job($job)
{
return $this->call(function () use ($job) {
dispatch(is_string($job) ? resolve($job) : $job);
})->name(is_string($job) ? $job : get_class($job));
}

/**
* Add a new command event to the schedule.
*
Expand Down

0 comments on commit 7bb67e2

Please sign in to comment.