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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user