Skip to content

Commit

Permalink
files fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jgivoni committed Feb 12, 2025
1 parent 4471760 commit 6eb0038
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 59 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@
->setRules([
'@PSR12' => true,
'concat_space' => ['spacing' => 'one'],
'new_with_parentheses' => false,
])
->setFinder($finder);
4 changes: 2 additions & 2 deletions src/CacheItemsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
*/
trait CacheItemsTrait
{
static string $CACHE_KEY_PREFIX = 'flysystem_item_';
static string $CACHE_KEY_HASH_SALT = '563ce5132194441b';
public static string $CACHE_KEY_PREFIX = 'flysystem_item_';
public static string $CACHE_KEY_HASH_SALT = '563ce5132194441b';

protected function getCacheItem(string $path): CacheItemInterface
{
Expand Down
2 changes: 1 addition & 1 deletion tests/CacheAdapter_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function writing_and_reading_files_with_special_path(string $path): void
/**
* "Override" function from parent which is not static and thus incompatible with phpunit 10
* @todo Remove when https://github.com/thephpleague/flysystem-adapter-test-utilities/commit/bf4c950b176bbefcc49c443cdab1ffb62a9fef5c is tagged (version >= 3.16?)
* @return Generator
* @return Generator
*/
public static function filenameProvider2(): Generator
{
Expand Down
6 changes: 3 additions & 3 deletions tests/CacheTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function setUp(): void
}

/**
* @param array<string, FileAttributes|DirectoryAttributes> $items
* @param array<string, FileAttributes|DirectoryAttributes> $items
*/
protected function setupCache(array $items): void
{
Expand All @@ -71,7 +71,7 @@ protected function setupCache(array $items): void
}

/**
* @param array<string, string> $items
* @param array<string, string> $items
*/
protected function setupFiles(array $items): void
{
Expand All @@ -81,7 +81,7 @@ protected function setupFiles(array $items): void
}

/**
* @param array<string, StorageAttributes|FileAttributes|DirectoryAttributes|null> $items
* @param array<string, StorageAttributes|FileAttributes|DirectoryAttributes|null> $items
*/
protected function assertCachedItems(array $items): void
{
Expand Down
6 changes: 3 additions & 3 deletions tests/Copy_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class Copy_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -27,7 +27,7 @@ public function copy_ok(string $source, FileAttributes|null $expectedSourceCache
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -36,7 +36,7 @@ public static function dataProvider(): iterable
yield 'cache item is created' => ['non-cached-file', \null, new FileAttributes('destination')];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_copy(): void
Expand Down
4 changes: 2 additions & 2 deletions tests/CreateDirectory_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class CreateDirectory_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -21,7 +21,7 @@ public function directory_is_cached_after_creating(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand Down
6 changes: 3 additions & 3 deletions tests/DeleteDirectory_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class DeleteDirectory_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -20,7 +20,7 @@ public function directory_is_not_cached_deleting(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -41,7 +41,7 @@ public function nested_files_are_purged_from_cache(): void
]);
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_delete(): void
Expand Down
6 changes: 3 additions & 3 deletions tests/Delete_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Delete_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -20,7 +20,7 @@ public function file_is_not_cached_deleting(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -29,7 +29,7 @@ public static function dataProvider(): iterable
yield 'non cached file stays uncached' => ['non-cached-file'];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_delete(): void
Expand Down
6 changes: 3 additions & 3 deletions tests/DirectoryExists_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class DirectoryExists_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -18,7 +18,7 @@ public function directory_exists_ok(string $path, bool $expectedResult): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -30,7 +30,7 @@ public static function dataProvider(): iterable
yield 'file is not a directory' => ['fully-cached-file', false];
}

/**
/**
* @test
*/
public function directory_is_cached_after_checking_filesystem(): void
Expand Down
12 changes: 6 additions & 6 deletions tests/GetChecksum_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function setUp(): void
]);
}

/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -35,7 +35,7 @@ public function get_checksum(string $path, string $expectedChecksum): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -45,7 +45,7 @@ public static function dataProvider(): iterable
yield 'file is not cached' => ['non-cached-file', md5('0123456789')];
}

/**
/**
* @test
* @dataProvider aws_dataProvider
*/
Expand All @@ -62,7 +62,7 @@ public function with_mock_aws_adapter(string $path, string $expectedChecksum): v
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function aws_dataProvider(): iterable
Expand All @@ -84,7 +84,7 @@ public function error(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function errorDataProvider(): iterable
Expand All @@ -94,7 +94,7 @@ public static function errorDataProvider(): iterable
yield 'Path is directory (non-cached)' => ['non-cached-directory'];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_get(): void
Expand Down
8 changes: 4 additions & 4 deletions tests/GetFileSize_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class GetFileSize_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -18,7 +18,7 @@ public function get_fileSize(string $path, int $expectedFileSize): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -41,7 +41,7 @@ public function error(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function errorDataProvider(): iterable
Expand All @@ -51,7 +51,7 @@ public static function errorDataProvider(): iterable
yield 'Path is directory (non-cached)' => ['non-cached-directory'];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_get(): void
Expand Down
8 changes: 4 additions & 4 deletions tests/GetLastModified_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class GetLastModified_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -18,7 +18,7 @@ public function get_lastModified(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -38,7 +38,7 @@ public function error(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function errorDataProvider(): iterable
Expand All @@ -48,7 +48,7 @@ public static function errorDataProvider(): iterable
yield 'Path is directory (non-cached)' => ['non-cached-directory'];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_get(): void
Expand Down
10 changes: 5 additions & 5 deletions tests/GetMimetype_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class GetMimetype_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -22,7 +22,7 @@ public function get_mimetype(string $path, StorageAttributes $expectedResult): v
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -32,7 +32,7 @@ public static function dataProvider(): iterable
yield 'file is not cached but exists in the filesystem' => ['non-cached-file.txt', new FileAttributes('non-cached-file.txt', mimeType: 'text/plain')];
}

/**
/**
* @test
*/
public function file_is_cached_after_checking_filesystem(): void
Expand All @@ -57,7 +57,7 @@ public function error(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function errorDataProvider(): iterable
Expand All @@ -67,7 +67,7 @@ public static function errorDataProvider(): iterable
yield 'Path is directory (non-cached)' => ['non-cached-directory'];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_get(): void
Expand Down
10 changes: 5 additions & 5 deletions tests/GetVisibility_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class GetVisibility_Test extends CacheTestCase
{
/**
/**
* @test
* @dataProvider dataProvider
*/
Expand All @@ -21,7 +21,7 @@ public function get_visibility(string $path, StorageAttributes $expectedResult):
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function dataProvider(): iterable
Expand All @@ -31,7 +31,7 @@ public static function dataProvider(): iterable
yield 'file is not cached but exists in the filesystem' => ['non-cached-file', new FileAttributes('non-cached-file', visibility: Visibility::PUBLIC)];
}

/**
/**
* @test
*/
public function file_is_cached_after_checking_filesystem(): void
Expand All @@ -56,7 +56,7 @@ public function error(string $path): void
}

/**
*
*
* @return iterable<array<mixed>>
*/
public static function errorDataProvider(): iterable
Expand All @@ -66,7 +66,7 @@ public static function errorDataProvider(): iterable
yield 'Path is directory (non-cached)' => ['non-cached-directory'];
}

/**
/**
* @test
*/
public function cache_is_purged_after_unsuccessful_get(): void
Expand Down
Loading

0 comments on commit 6eb0038

Please sign in to comment.