forked from thephpleague/flysystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turned static adapter into a static registry.
- Loading branch information
1 parent
8e58e6f
commit 12f635f
Showing
3 changed files
with
28 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace League\Flysystem\InMemory; | ||
|
||
class StaticInMemoryAdapterRegistry | ||
{ | ||
/** @var array<string, InMemoryFilesystemAdapter> */ | ||
private static array $filesystems = []; | ||
|
||
public static function get(string $name = 'default'): InMemoryFilesystemAdapter | ||
{ | ||
return static::$filesystems[$name] ??= new InMemoryFilesystemAdapter(); | ||
} | ||
|
||
public static function deleteAllFilesystems(): void | ||
{ | ||
self::$filesystems = []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.