diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-10-19 17:11:53 +0200 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2021-11-23 09:28:56 +0100 |
commit | 113756db30fcbffe9e90b54c29e78dee0676109f (patch) | |
tree | 8eeaad5ea33957cd2c9ef37dbb05c5e779c48216 /lib/private/Files | |
parent | 129de6079e53e0ac9dbf9d7c25ec1670ae0ff572 (diff) | |
download | nextcloud-server-113756db30fcbffe9e90b54c29e78dee0676109f.tar.gz nextcloud-server-113756db30fcbffe9e90b54c29e78dee0676109f.zip |
Fix ArrayAccess and JsonSerializable return types
First round of modifications for PHP 8.1
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Cache/CacheEntry.php | 10 | ||||
-rw-r--r-- | lib/private/Files/FileInfo.php | 10 |
2 files changed, 14 insertions, 6 deletions
diff --git a/lib/private/Files/Cache/CacheEntry.php b/lib/private/Files/Cache/CacheEntry.php index 156f075c2d0..12f0273fb6e 100644 --- a/lib/private/Files/Cache/CacheEntry.php +++ b/lib/private/Files/Cache/CacheEntry.php @@ -37,18 +37,22 @@ class CacheEntry implements ICacheEntry { $this->data = $data; } - public function offsetSet($offset, $value) { + public function offsetSet($offset, $value): void { $this->data[$offset] = $value; } - public function offsetExists($offset) { + public function offsetExists($offset): bool { return isset($this->data[$offset]); } - public function offsetUnset($offset) { + public function offsetUnset($offset): void { unset($this->data[$offset]); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if (isset($this->data[$offset])) { return $this->data[$offset]; diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index 8a8de6e4c19..2f361fc051d 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -104,18 +104,22 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { $this->rawSize = $this->data['size'] ?? 0; } - public function offsetSet($offset, $value) { + public function offsetSet($offset, $value): void { $this->data[$offset] = $value; } - public function offsetExists($offset) { + public function offsetExists($offset): bool { return isset($this->data[$offset]); } - public function offsetUnset($offset) { + public function offsetUnset($offset): void { unset($this->data[$offset]); } + /** + * @return mixed + */ + #[\ReturnTypeWillChange] public function offsetGet($offset) { if ($offset === 'type') { return $this->getType(); |