1
0
mirror of https://github.com/flarum/core.git synced 2025-10-12 23:44:27 +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

@@ -11,6 +11,7 @@ namespace Flarum\Notification;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Notification\Blueprint\DiscussionRenamedBlueprint;
use Illuminate\Contracts\Container\Container;
class NotificationServiceProvider extends AbstractServiceProvider
{
@@ -36,28 +37,28 @@ class NotificationServiceProvider extends AbstractServiceProvider
/**
* {@inheritdoc}
*/
public function boot()
public function boot(Container $container)
{
$this->setNotificationDrivers();
$this->setNotificationTypes();
$this->setNotificationDrivers($container);
$this->setNotificationTypes($container);
}
/**
* Register notification drivers.
*/
protected function setNotificationDrivers()
protected function setNotificationDrivers(Container $container)
{
foreach ($this->container->make('flarum.notification.drivers') as $driverName => $driver) {
NotificationSyncer::addNotificationDriver($driverName, $this->container->make($driver));
foreach ($container->make('flarum.notification.drivers') as $driverName => $driver) {
NotificationSyncer::addNotificationDriver($driverName, $container->make($driver));
}
}
/**
* Register notification types.
*/
protected function setNotificationTypes()
protected function setNotificationTypes(Container $container)
{
$blueprints = $this->container->make('flarum.notification.blueprints');
$blueprints = $container->make('flarum.notification.blueprints');
foreach ($blueprints as $blueprint => $driversEnabledByDefault) {
$this->addType($blueprint, $driversEnabledByDefault);