Laravel: Stop calling deprecated fire() method

This has been deprecated and removed from the contract for a long time,
and it will be completely dropped in v5.8, our next upgrade target.
This commit is contained in:
Franz Liedke 2020-03-28 01:27:55 +01:00
parent 9ae8bcdffe
commit f4ab6f4b1f
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4
8 changed files with 10 additions and 10 deletions

View File

@ -100,7 +100,7 @@ class ApiServiceProvider extends AbstractServiceProvider
'discussionRenamed' => BasicDiscussionSerializer::class
];
$this->app->make('events')->fire(
$this->app->make('events')->dispatch(
new ConfigureNotificationTypes($blueprints, $serializers)
);
@ -121,7 +121,7 @@ class ApiServiceProvider extends AbstractServiceProvider
$callback = include __DIR__.'/routes.php';
$callback($routes, $factory);
$this->app->make('events')->fire(
$this->app->make('events')->dispatch(
new ConfigureApiRoutes($routes, $factory)
);
}

View File

@ -52,7 +52,7 @@ class Server
$events = $app->make(Dispatcher::class);
$events->fire(new Configuring($app, $console));
$events->dispatch(new Configuring($app, $console));
}
private function handleErrors(Application $app, ConsoleApplication $console)

View File

@ -187,7 +187,7 @@ class ForumServiceProvider extends AbstractServiceProvider
$callback = include __DIR__.'/routes.php';
$callback($routes, $factory);
$this->app->make('events')->fire(
$this->app->make('events')->dispatch(
new ConfigureForumRoutes($routes, $factory)
);
}

View File

@ -434,7 +434,7 @@ class Application extends Container implements ApplicationContract
*/
protected function markAsRegistered($provider)
{
$this['events']->fire($class = get_class($provider), [$provider]);
$this['events']->dispatch($class = get_class($provider), [$provider]);
$this->serviceProviders[] = $provider;

View File

@ -34,7 +34,7 @@ class NotificationServiceProvider extends AbstractServiceProvider
DiscussionRenamedBlueprint::class => ['alert']
];
$this->app->make('events')->fire(
$this->app->make('events')->dispatch(
new ConfigureNotificationTypes($blueprints)
);

View File

@ -34,7 +34,7 @@ class PostServiceProvider extends AbstractServiceProvider
DiscussionRenamedPost::class
];
$this->app->make('events')->fire(
$this->app->make('events')->dispatch(
new ConfigurePostTypes($models)
);

View File

@ -49,7 +49,7 @@ class SearchServiceProvider extends AbstractServiceProvider
$gambits->add(EmailGambit::class);
$gambits->add(GroupGambit::class);
$app->make('events')->fire(
$app->make('events')->dispatch(
new ConfigureUserGambits($gambits)
);
@ -70,7 +70,7 @@ class SearchServiceProvider extends AbstractServiceProvider
$gambits->add(HiddenGambit::class);
$gambits->add(UnreadGambit::class);
$app->make('events')->fire(
$app->make('events')->dispatch(
new ConfigureDiscussionGambits($gambits)
);

View File

@ -90,6 +90,6 @@ if (! function_exists('event')) {
*/
function event($event, $payload = [], $halt = false)
{
return app('events')->fire($event, $payload, $halt);
return app('events')->dispatch($event, $payload, $halt);
}
}