diff --git a/src/Console/Schedule.php b/src/Console/Schedule.php index 33d223960..6deba8eb0 100644 --- a/src/Console/Schedule.php +++ b/src/Console/Schedule.php @@ -17,24 +17,21 @@ class Schedule extends LaravelSchedule { public function dueEvents($container) { - return (new Collection($this->events))->filter->isDue(new FakeApp($container)); - } -} - -class FakeApp -{ - public function __construct($container) - { - $this->config = $container->make(Config::class); - } - - public function isDownForMaintenance() - { - return $this->config->inMaintenanceMode(); - } - - public function environment() - { - return ''; + return (new Collection($this->events))->filter->isDue(new class($container) { + public function __construct($container) + { + $this->config = $container->make(Config::class); + } + + public function isDownForMaintenance() + { + return $this->config->inMaintenanceMode(); + } + + public function environment() + { + return ''; + } + }); } }