In Memory Filesystem Adapter

This adapter keeps the filesystem completely in memory. This is useful when you need a filesystem, but donโ€™t want it persisted. It can be done by using the League\Flysystem\InMemory\InMemoryFilesystemAdapter.

This adapter can be used in tests as a test double and removes much of the need to mock your Flysystem dependency.

Installation:

composer require league/flysystem-memory:^3.0

Usage:

// The internal adapter
$adapter = new League\Flysystem\InMemory\InMemoryFilesystemAdapter();

// The FilesystemOperator
$filesystem = new League\Flysystem\Filesystem($adapter);