diff --git a/src/Api/ApiServiceProvider.php b/src/Api/ApiServiceProvider.php index 4f3cfe37b..739a44dfc 100644 --- a/src/Api/ApiServiceProvider.php +++ b/src/Api/ApiServiceProvider.php @@ -13,7 +13,6 @@ use Flarum\Api\Controller\AbstractSerializeController; use Flarum\Api\Serializer\AbstractSerializer; use Flarum\Api\Serializer\BasicDiscussionSerializer; use Flarum\Api\Serializer\NotificationSerializer; -use Flarum\Event\ConfigureNotificationTypes; use Flarum\Foundation\AbstractServiceProvider; use Flarum\Foundation\ErrorHandling\JsonApiFormatter; use Flarum\Foundation\ErrorHandling\Registry; @@ -122,14 +121,8 @@ class ApiServiceProvider extends AbstractServiceProvider */ protected function setNotificationSerializers() { - $blueprints = []; $serializers = $this->app->make('flarum.api.notification_serializers'); - // Deprecated in beta 15, remove in beta 16 - $this->app->make('events')->dispatch( - new ConfigureNotificationTypes($blueprints, $serializers) - ); - foreach ($serializers as $type => $serializer) { NotificationSerializer::setSubjectSerializer($type, $serializer); } diff --git a/src/Event/ConfigureNotificationTypes.php b/src/Event/ConfigureNotificationTypes.php deleted file mode 100644 index 89185b916..000000000 --- a/src/Event/ConfigureNotificationTypes.php +++ /dev/null @@ -1,58 +0,0 @@ -blueprints = &$blueprints; - $this->serializers = &$serializers; - } - - /** - * @param string $blueprint - * @param string $serializer - * @param array $enabledByDefault - */ - public function add($blueprint, $serializer, $enabledByDefault = []) - { - if (! (new ReflectionClass($blueprint))->implementsInterface(BlueprintInterface::class)) { - throw new InvalidArgumentException( - 'Notification blueprint '.$blueprint.' must implement '.BlueprintInterface::class - ); - } - - $this->blueprints[$blueprint] = $enabledByDefault; - - $this->serializers[$blueprint::getType()] = $serializer; - } -} diff --git a/src/Notification/Event/Sending.php b/src/Notification/Event/Sending.php deleted file mode 100644 index 25858a2db..000000000 --- a/src/Notification/Event/Sending.php +++ /dev/null @@ -1,42 +0,0 @@ -blueprint = $blueprint; - $this->users = &$users; - } -} diff --git a/src/Notification/NotificationServiceProvider.php b/src/Notification/NotificationServiceProvider.php index 7a169e1f6..b41be729d 100644 --- a/src/Notification/NotificationServiceProvider.php +++ b/src/Notification/NotificationServiceProvider.php @@ -9,7 +9,6 @@ namespace Flarum\Notification; -use Flarum\Event\ConfigureNotificationTypes; use Flarum\Foundation\AbstractServiceProvider; use Flarum\Notification\Blueprint\DiscussionRenamedBlueprint; @@ -60,11 +59,6 @@ class NotificationServiceProvider extends AbstractServiceProvider { $blueprints = $this->app->make('flarum.notification.blueprints'); - // Deprecated in beta 15, remove in beta 16 - $this->app->make('events')->dispatch( - new ConfigureNotificationTypes($blueprints) - ); - foreach ($blueprints as $blueprint => $driversEnabledByDefault) { $this->addType($blueprint, $driversEnabledByDefault); } diff --git a/src/Notification/NotificationSyncer.php b/src/Notification/NotificationSyncer.php index 7e7a5c4ff..22072d941 100644 --- a/src/Notification/NotificationSyncer.php +++ b/src/Notification/NotificationSyncer.php @@ -11,7 +11,6 @@ namespace Flarum\Notification; use Flarum\Notification\Blueprint\BlueprintInterface; use Flarum\Notification\Driver\NotificationDriverInterface; -use Flarum\Notification\Event\Sending; use Flarum\User\User; /** @@ -110,11 +109,6 @@ class NotificationSyncer foreach (static::getNotificationDrivers() as $driverName => $driver) { $driver->send($blueprint, $newRecipients); } - - if (count($newRecipients)) { - // Deprecated in beta 15, removed in beta 16 - event(new Sending($blueprint, $newRecipients)); - } } /**