From f4ab6f4b1f5fb2f254b7fb65fd924ff65c3c1993 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 28 Mar 2020 01:27:55 +0100 Subject: [PATCH] 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. --- src/Api/ApiServiceProvider.php | 4 ++-- src/Console/Server.php | 2 +- src/Forum/ForumServiceProvider.php | 2 +- src/Foundation/Application.php | 2 +- src/Notification/NotificationServiceProvider.php | 2 +- src/Post/PostServiceProvider.php | 2 +- src/Search/SearchServiceProvider.php | 4 ++-- src/helpers.php | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Api/ApiServiceProvider.php b/src/Api/ApiServiceProvider.php index d77d9c2b3..2d4afdf76 100644 --- a/src/Api/ApiServiceProvider.php +++ b/src/Api/ApiServiceProvider.php @@ -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) ); } diff --git a/src/Console/Server.php b/src/Console/Server.php index 7c406c499..832f5a4e0 100644 --- a/src/Console/Server.php +++ b/src/Console/Server.php @@ -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) diff --git a/src/Forum/ForumServiceProvider.php b/src/Forum/ForumServiceProvider.php index 4d63486bc..788686207 100644 --- a/src/Forum/ForumServiceProvider.php +++ b/src/Forum/ForumServiceProvider.php @@ -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) ); } diff --git a/src/Foundation/Application.php b/src/Foundation/Application.php index f3aebca42..fe9372b61 100644 --- a/src/Foundation/Application.php +++ b/src/Foundation/Application.php @@ -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; diff --git a/src/Notification/NotificationServiceProvider.php b/src/Notification/NotificationServiceProvider.php index e1d61e68d..3715cb3a5 100644 --- a/src/Notification/NotificationServiceProvider.php +++ b/src/Notification/NotificationServiceProvider.php @@ -34,7 +34,7 @@ class NotificationServiceProvider extends AbstractServiceProvider DiscussionRenamedBlueprint::class => ['alert'] ]; - $this->app->make('events')->fire( + $this->app->make('events')->dispatch( new ConfigureNotificationTypes($blueprints) ); diff --git a/src/Post/PostServiceProvider.php b/src/Post/PostServiceProvider.php index b5d604ccb..5fda0c859 100644 --- a/src/Post/PostServiceProvider.php +++ b/src/Post/PostServiceProvider.php @@ -34,7 +34,7 @@ class PostServiceProvider extends AbstractServiceProvider DiscussionRenamedPost::class ]; - $this->app->make('events')->fire( + $this->app->make('events')->dispatch( new ConfigurePostTypes($models) ); diff --git a/src/Search/SearchServiceProvider.php b/src/Search/SearchServiceProvider.php index 55047fc3c..e61de63b1 100644 --- a/src/Search/SearchServiceProvider.php +++ b/src/Search/SearchServiceProvider.php @@ -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) ); diff --git a/src/helpers.php b/src/helpers.php index 4199035a4..eb6a6db5c 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -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); } }