summaryrefslogtreecommitdiffstats
path: root/lib/private/files/view.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-12-02 14:59:13 +0100
committerRobin Appelman <icewind@owncloud.com>2016-01-14 12:54:42 +0100
commit6d321f5f6b4e22f0c8124572662361a1f53e7c3a (patch)
treeaeea16e4d4174e6491a7de9ad0d207a3cd83c927 /lib/private/files/view.php
parent5d0451b84862c2c905b7d1a8d5943ac53d87f990 (diff)
downloadnextcloud-server-6d321f5f6b4e22f0c8124572662361a1f53e7c3a.tar.gz
nextcloud-server-6d321f5f6b4e22f0c8124572662361a1f53e7c3a.zip
Return a class from cache operations instead of an array
Diffstat (limited to 'lib/private/files/view.php')
-rw-r--r--lib/private/files/view.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php
index 7b0f1d37255..6f8a6db9f99 100644
--- a/lib/private/files/view.php
+++ b/lib/private/files/view.php
@@ -47,6 +47,7 @@ use OC\Files\Cache\Updater;
use OC\Files\Mount\MoveableMount;
use OC\Files\Storage\Storage;
use OC\User\User;
+use OCP\Files\Cache\ICacheEntry;
use OCP\Files\FileNameTooLongException;
use OCP\Files\InvalidCharacterInPathException;
use OCP\Files\InvalidPathException;
@@ -1274,7 +1275,7 @@ class View {
if ($storage) {
$data = $this->getCacheEntry($storage, $internalPath, $relativePath);
- if (!is_array($data)) {
+ if (!$data instanceof ICacheEntry) {
return false;
}
@@ -1334,7 +1335,7 @@ class View {
$data = $this->getCacheEntry($storage, $internalPath, $directory);
- if (!is_array($data) || !isset($data['fileid'])) {
+ if (!$data instanceof ICacheEntry || !isset($data['fileid'])) {
return [];
}
@@ -1345,7 +1346,7 @@ class View {
/**
* @var \OC\Files\FileInfo[] $files
*/
- $files = array_map(function (array $content) use ($path, $storage, $mount, $sharingDisabled) {
+ $files = array_map(function (ICacheEntry $content) use ($path, $storage, $mount, $sharingDisabled) {
if ($sharingDisabled) {
$content['permissions'] = $content['permissions'] & ~\OCP\Constants::PERMISSION_SHARE;
}