From 25f5e39b2b8bc2af1569e99e686841de14d5b082 Mon Sep 17 00:00:00 2001 From: Joseph Madden Date: Fri, 27 Oct 2023 03:50:17 -0500 Subject: [PATCH] Update to allow for php 8.1 support (#2) Co-authored-by: Joe --- composer.json | 4 ++-- src/CacheItemsTrait.php | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/composer.json b/composer.json index 9077cbd..7714a0d 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ } }, "require": { - "php": "^8.2", + "php": "^8.1", "league/flysystem": "^3.0", "psr/cache": "^3.0" }, @@ -34,4 +34,4 @@ "symfony/cache": "^6.3", "league/flysystem-aws-s3-v3": "^3.15" } -} \ No newline at end of file +} diff --git a/src/CacheItemsTrait.php b/src/CacheItemsTrait.php index 7f0f928..402d8ba 100644 --- a/src/CacheItemsTrait.php +++ b/src/CacheItemsTrait.php @@ -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 */ protected $cacheItems = []; @@ -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 @@ -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( @@ -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( @@ -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 */