Skip to content

Commit

Permalink
Update to allow for php 8.1 support (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: Joe <[email protected]>
  • Loading branch information
obj63mc and obj63mc authored Oct 27, 2023
1 parent edf717c commit 25f5e39
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
},
"require": {
"php": "^8.2",
"php": "^8.1",
"league/flysystem": "^3.0",
"psr/cache": "^3.0"
},
Expand All @@ -34,4 +34,4 @@
"symfony/cache": "^6.3",
"league/flysystem-aws-s3-v3": "^3.15"
}
}
}
14 changes: 7 additions & 7 deletions src/CacheItemsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

/**
* Trait for handling cache items in CacheAdapter
*
*
* @property FilesystemAdapter $adapter
* @property CacheItemPoolInterface $cache
*/
trait CacheItemsTrait
{
const CACHE_KEY_PREFIX = 'flysystem_item_';
const CACHE_KEY_HASH_SALT = '563ce5132194441b';
static $CACHE_KEY_PREFIX = 'flysystem_item_';
static $CACHE_KEY_HASH_SALT = '563ce5132194441b';

/** @var array<CacheItemInterface> */
protected $cacheItems = [];
Expand Down Expand Up @@ -61,7 +61,7 @@ protected function deleteCacheItem(CacheItemInterface $cacheItem): void

public static function getCacheItemKey(string $path): string
{
return self::CACHE_KEY_PREFIX . md5(self::CACHE_KEY_HASH_SALT . $path);
return self::$CACHE_KEY_PREFIX . md5(self::$CACHE_KEY_HASH_SALT . $path);
}

protected function addCacheEntry(string $path, StorageAttributes $storageAttributes): void
Expand All @@ -76,7 +76,7 @@ protected function addCacheEntry(string $path, StorageAttributes $storageAttribu
/**
* Returns a new FileAttributes with all properties from $fileAttributesExtension
* overriding existing properties from $fileAttributesBase (with the exception of path)
*
*
* For extraMetadata, each individual element in the array is also merged
*/
protected static function mergeFileAttributes(
Expand All @@ -103,7 +103,7 @@ protected static function mergeFileAttributes(
/**
* Returns a new DirectoryAttributes with all properties from $directoryAttributesExtension
* overriding existing properties from $directoryAttributesBase (with the exception of path)
*
*
* For extraMetadata, each individual element in the array is also merged
*/
protected static function mergeDirectoryAttributes(
Expand All @@ -126,7 +126,7 @@ protected static function mergeDirectoryAttributes(
/**
* Returns FileAttributes from cache if desired attribute is found,
* or loads the desired missing attribute from the adapter and merges it with the cached attributes.
*
*
* @param Closure $loader Returns FileAttributes with the desired attribute loaded from adapter
* @param Closure $attributeAccessor Returns value of desired attribute from cached item
*/
Expand Down

0 comments on commit 25f5e39

Please sign in to comment.