Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #25 #26

Merged
merged 4 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 24 additions & 25 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ public function __construct($options = null, ?FilesystemInteractionInterface $fi

// clean total space buffer on change cache_dir
$events = $this->getEventManager();
$handle = null;
$handle = function (): void {
};
$totalSpace = &$this->totalSpace;
$callback = function ($event) use (&$events, &$handle, &$totalSpace) {
$params = $event->getParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ final class DelayedFilesystemInteraction implements FilesystemInteractionInterfa
/** @var FilesystemInteractionInterface */
private $filesystem;

/** @var int */
/**
* @var int
* @psalm-var positive-int
*/
private $delay;

/** @psalm-param positive-int $delay */
public function __construct(int $delay)
{
$this->filesystem = new LocalFilesystemInteraction();
Expand Down
10 changes: 10 additions & 0 deletions test/unit/FilesystemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down