1
0
mirror of https://github.com/flarum/core.git synced 2025-10-14 08:24:28 +02:00

Use class constant to get qualified class names

This commit is contained in:
Franz Liedke
2018-12-14 01:47:54 +01:00
parent 5c9fa4c62d
commit 3e0cd3a21f
6 changed files with 44 additions and 26 deletions

View File

@@ -15,6 +15,9 @@ use Flarum\Event\ConfigureUserPreferences;
use Flarum\Event\GetPermission;
use Flarum\Foundation\AbstractServiceProvider;
use Illuminate\Contracts\Container\Container;
use Illuminate\Contracts\Auth\Access\Gate as GateContract;
use Illuminate\Contracts\Filesystem\Factory;
use League\Flysystem\FilesystemInterface;
use RuntimeException;
class UserServiceProvider extends AbstractServiceProvider
@@ -36,18 +39,18 @@ class UserServiceProvider extends AbstractServiceProvider
});
});
$this->app->alias('flarum.gate', 'Illuminate\Contracts\Auth\Access\Gate');
$this->app->alias('flarum.gate', GateContract::class);
$this->app->alias('flarum.gate', Gate::class);
}
protected function registerAvatarsFilesystem()
{
$avatarsFilesystem = function (Container $app) {
return $app->make('Illuminate\Contracts\Filesystem\Factory')->disk('flarum-avatars')->getDriver();
return $app->make(Factory::class)->disk('flarum-avatars')->getDriver();
};
$this->app->when(AvatarUploader::class)
->needs('League\Flysystem\FilesystemInterface')
->needs(FilesystemInterface::class)
->give($avatarsFilesystem);
}