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

@@ -12,6 +12,7 @@ namespace Flarum\Filesystem;
use Flarum\Foundation\AbstractServiceProvider;
use Flarum\Foundation\Paths;
use Flarum\Http\UrlGenerator;
use Illuminate\Contracts\Container\Container;
use Illuminate\Filesystem\Filesystem;
class FilesystemServiceProvider extends AbstractServiceProvider
@@ -46,17 +47,17 @@ class FilesystemServiceProvider extends AbstractServiceProvider
return [];
});
$this->container->singleton('flarum.filesystem.resolved_drivers', function () {
return array_map(function ($driverClass) {
return $this->container->make($driverClass);
}, $this->container->make('flarum.filesystem.drivers'));
$this->container->singleton('flarum.filesystem.resolved_drivers', function (Container $container) {
return array_map(function ($driverClass) use ($container) {
return $container->make($driverClass);
}, $container->make('flarum.filesystem.drivers'));
});
$this->container->singleton('filesystem', function () {
$this->container->singleton('filesystem', function (Container $container) {
return new FilesystemManager(
$this->container,
$this->container->make('flarum.filesystem.disks'),
$this->container->make('flarum.filesystem.resolved_drivers')
$container,
$container->make('flarum.filesystem.disks'),
$container->make('flarum.filesystem.resolved_drivers')
);
});
}