mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
chore(files): Use public API where possible
This is not fixing all issues in the helper, but at least where possible use the public methods. Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
9aafc0f989
commit
ede38709b5
2 changed files with 14 additions and 19 deletions
|
|
@ -119,16 +119,18 @@ class Helper {
|
|||
public static function formatFileInfo(FileInfo $i) {
|
||||
$entry = [];
|
||||
|
||||
$entry['id'] = $i['fileid'];
|
||||
$entry['parentId'] = $i['parent'];
|
||||
$entry['mtime'] = $i['mtime'] * 1000;
|
||||
$entry['id'] = $i->getId();
|
||||
$entry['parentId'] = $i->getParentId();
|
||||
$entry['mtime'] = $i->getMtime() * 1000;
|
||||
// only pick out the needed attributes
|
||||
$entry['name'] = $i->getName();
|
||||
$entry['permissions'] = $i['permissions'];
|
||||
$entry['mimetype'] = $i['mimetype'];
|
||||
$entry['size'] = $i['size'];
|
||||
$entry['type'] = $i['type'];
|
||||
$entry['etag'] = $i['etag'];
|
||||
$entry['permissions'] = $i->getPermissions();
|
||||
$entry['mimetype'] = $i->getMimetype();
|
||||
$entry['size'] = $i->getSize();
|
||||
$entry['type'] = $i->getType();
|
||||
$entry['etag'] = $i->getEtag();
|
||||
// TODO: this is using the private implementation of FileInfo
|
||||
// the array access is not part of the public interface
|
||||
if (isset($i['tags'])) {
|
||||
$entry['tags'] = $i['tags'];
|
||||
}
|
||||
|
|
@ -138,6 +140,10 @@ class Helper {
|
|||
if (isset($i['is_share_mount_point'])) {
|
||||
$entry['isShareMountPoint'] = $i['is_share_mount_point'];
|
||||
}
|
||||
if (isset($i['extraData'])) {
|
||||
$entry['extraData'] = $i['extraData'];
|
||||
}
|
||||
|
||||
$mountType = null;
|
||||
$mount = $i->getMountPoint();
|
||||
$mountType = $mount->getMountType();
|
||||
|
|
@ -147,9 +153,6 @@ class Helper {
|
|||
}
|
||||
$entry['mountType'] = $mountType;
|
||||
}
|
||||
if (isset($i['extraData'])) {
|
||||
$entry['extraData'] = $i['extraData'];
|
||||
}
|
||||
return $entry;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -802,14 +802,6 @@
|
|||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
<code><![CDATA[$i]]></code>
|
||||
</UndefinedInterfaceMethod>
|
||||
</file>
|
||||
<file src="apps/files/lib/Service/OwnershipTransferService.php">
|
||||
|
|
|
|||
Loading…
Reference in a new issue