Skip to content

Commit

Permalink
Merge pull request #31 from hmazter/30-resolve-schedule-later-to-inlu…
Browse files Browse the repository at this point in the history
…de-events

Resolve the Schedule class from the container instead of DI, fixes #30
  • Loading branch information
hmazter authored Sep 8, 2019
2 parents 28f14ec + 47e11df commit daf9f24
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/ScheduleList.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,16 @@

class ScheduleList
{
/**
* @var Schedule
*/
private $schedule;

/**
* @var ConsoleKernel
*/
private $consoleKernel;

/**
* @param Schedule $schedule
* @param ConsoleKernel $consoleKernel
*/
public function __construct(Schedule $schedule, ConsoleKernel $consoleKernel)
public function __construct(ConsoleKernel $consoleKernel)
{
$this->schedule = $schedule;
$this->consoleKernel = $consoleKernel;
}

Expand All @@ -38,7 +31,7 @@ public function all(): array
$events = [];

/** @var Event $event */
foreach ($this->schedule->events() as $event) {
foreach (app(Schedule::class)->events() as $event) {
$fullCommand = $event->buildCommand();

if ($event instanceof CallbackEvent) {
Expand Down

0 comments on commit daf9f24

Please sign in to comment.