1
0
mirror of https://github.com/flarum/core.git synced 2025-08-18 06:11:23 +02:00

fixed container bindings use of container (#2807)

This commit is contained in:
Daniël Klabbers
2021-04-29 21:33:51 +02:00
committed by GitHub
parent 40b47de9e1
commit fcb5778705
23 changed files with 246 additions and 245 deletions

View File

@@ -18,6 +18,7 @@ use Flarum\Foundation\Console\InfoCommand;
use Illuminate\Console\Scheduling\Schedule as LaravelSchedule;
use Illuminate\Console\Scheduling\ScheduleListCommand;
use Illuminate\Console\Scheduling\ScheduleRunCommand;
use Illuminate\Contracts\Container\Container;
class ConsoleServiceProvider extends AbstractServiceProvider
{
@@ -32,8 +33,8 @@ class ConsoleServiceProvider extends AbstractServiceProvider
define('ARTISAN_BINARY', 'flarum');
}
$this->container->singleton(LaravelSchedule::class, function () {
return $this->container->make(Schedule::class);
$this->container->singleton(LaravelSchedule::class, function (Container $container) {
return $container->make(Schedule::class);
});
$this->container->singleton('flarum.console.commands', function () {
@@ -56,11 +57,11 @@ class ConsoleServiceProvider extends AbstractServiceProvider
/**
* {@inheritDoc}
*/
public function boot()
public function boot(Container $container)
{
$schedule = $this->container->make(LaravelSchedule::class);
$schedule = $container->make(LaravelSchedule::class);
foreach ($this->container->make('flarum.console.scheduled') as $scheduled) {
foreach ($container->make('flarum.console.scheduled') as $scheduled) {
$event = $schedule->command($scheduled['command'], $scheduled['args']);
$scheduled['callback']($event);
}