From 0da89c0fa1609de994a6ba92b67f2d382d27c98e Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 13 Oct 2020 10:47:00 +0200 Subject: [PATCH] The file cache entry is array accessible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … so let's make this part of our API. We use it as array already. Signed-off-by: Christoph Wurst --- lib/private/Files/Cache/CacheEntry.php | 2 +- lib/public/Files/Cache/ICacheEntry.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Cache/CacheEntry.php b/lib/private/Files/Cache/CacheEntry.php index 744b88b5b5..a0ba902090 100644 --- a/lib/private/Files/Cache/CacheEntry.php +++ b/lib/private/Files/Cache/CacheEntry.php @@ -27,7 +27,7 @@ use OCP\Files\Cache\ICacheEntry; /** * meta data for a file or folder */ -class CacheEntry implements ICacheEntry, \ArrayAccess { +class CacheEntry implements ICacheEntry { /** * @var array */ diff --git a/lib/public/Files/Cache/ICacheEntry.php b/lib/public/Files/Cache/ICacheEntry.php index e3efe679cd..7a0e22496e 100644 --- a/lib/public/Files/Cache/ICacheEntry.php +++ b/lib/public/Files/Cache/ICacheEntry.php @@ -23,12 +23,18 @@ namespace OCP\Files\Cache; +use ArrayAccess; + /** * meta data for a file or folder * * @since 9.0.0 + * + * This interface extends \ArrayAccess since v21.0.0, previous versions only + * implemented it in the private implementation. Hence php would allow using the + * object as array, while strictly speaking it didn't support this. */ -interface ICacheEntry { +interface ICacheEntry extends ArrayAccess { public const DIRECTORY_MIMETYPE = 'httpd/unix-directory'; /**