diff --git a/src/Filesystem.php b/src/Filesystem.php index 1b1b7fe..4422045 100644 --- a/src/Filesystem.php +++ b/src/Filesystem.php @@ -106,7 +106,7 @@ public function __construct($options = null, ?FilesystemInteractionInterface $fi // clean total space buffer on change cache_dir $events = $this->getEventManager(); - $handle = function () { + $handle = function (): void { }; $totalSpace = &$this->totalSpace; $callback = function ($event) use (&$events, &$handle, &$totalSpace) { diff --git a/test/unit/FilesystemTest.php b/test/unit/FilesystemTest.php index ebe8f80..e9346cd 100644 --- a/test/unit/FilesystemTest.php +++ b/test/unit/FilesystemTest.php @@ -89,6 +89,16 @@ protected function tearDown(): void parent::tearDown(); } + public function testFileSystemeOptionIsUpdatedWhenFileSystemeOptionIsChange(): void + { + $storage = new Filesystem(); + $options = new FilesystemOptions(); + $storage->setOptions($options); + $options->setCacheDir($this->tmpCacheDir); + + $this->assertSame($this->tmpCacheDir, $storage->getOptions()->getCacheDir()); + } + public function testSetNoAtimeChangesAtimeOfMetadataCapability(): void { $capabilities = $this->storage->getCapabilities();