aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-03-22 19:35:05 +0100
committerRobin Appelman <robin@icewind.nl>2023-04-04 17:05:45 +0200
commit5267a740274b69055da16afe6084b58b9655f003 (patch)
tree90f08da3e535261e93340a95e2f35a332acb9859
parent8c9197d65ec44d6bd409f3222e6c6a7feab4e929 (diff)
downloadnextcloud-server-5267a740274b69055da16afe6084b58b9655f003.tar.gz
nextcloud-server-5267a740274b69055da16afe6084b58b9655f003.zip
fix type hints
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r--lib/private/Files/Cache/Cache.php8
-rw-r--r--lib/private/Files/Cache/HomeCache.php2
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheJail.php2
-rw-r--r--lib/private/Files/Cache/Wrapper/CacheWrapper.php2
4 files changed, 6 insertions, 8 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index 8ab852f121f..933fee5630f 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -899,8 +899,7 @@ class Cache implements ICache {
* calculate the size of a folder and set it in the cache
*
* @param string $path
- * @param array $entry (optional) meta data of the folder
- * @param bool $ignoreUnknown don't mark the folder size as unknown if any of it's children are unknown
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
* @return int
*/
public function calculateFolderSize($path, $entry = null) {
@@ -912,11 +911,11 @@ class Cache implements ICache {
* inner function because we can't add new params to the public function without breaking any child classes
*
* @param string $path
- * @param array $entry (optional) meta data of the folder
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
* @param bool $ignoreUnknown don't mark the folder size as unknown if any of it's children are unknown
* @return int
*/
- protected function calculateFolderSizeInner(string $path, array $entry = null, bool $ignoreUnknown = false) {
+ protected function calculateFolderSizeInner(string $path, $entry = null, bool $ignoreUnknown = false) {
$totalSize = 0;
if (is_null($entry) || !isset($entry['fileid'])) {
$entry = $this->get($path);
@@ -976,7 +975,6 @@ class Cache implements ICache {
$shouldWriteUnEncryptedSize = $unencryptedMax > 0 || $totalSize === 0 || $entry['unencrypted_size'] > 0;
if ($entry['size'] !== $totalSize || ($entry['unencrypted_size'] !== $unencryptedTotal && $shouldWriteUnEncryptedSize)) {
if ($shouldWriteUnEncryptedSize) {
-
// if all children have an unencrypted size of 0, just set the folder unencrypted size to 0 instead of summing the sizes
if ($unencryptedMax === 0) {
$unencryptedTotal = 0;
diff --git a/lib/private/Files/Cache/HomeCache.php b/lib/private/Files/Cache/HomeCache.php
index 4ece3ff2de6..9dbbb46c57b 100644
--- a/lib/private/Files/Cache/HomeCache.php
+++ b/lib/private/Files/Cache/HomeCache.php
@@ -35,7 +35,7 @@ class HomeCache extends Cache {
* get the size of a folder and set it in the cache
*
* @param string $path
- * @param array $entry (optional) meta data of the folder
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
* @return int
*/
public function calculateFolderSize($path, $entry = null) {
diff --git a/lib/private/Files/Cache/Wrapper/CacheJail.php b/lib/private/Files/Cache/Wrapper/CacheJail.php
index 628ca3ee0e0..a5075ceef86 100644
--- a/lib/private/Files/Cache/Wrapper/CacheJail.php
+++ b/lib/private/Files/Cache/Wrapper/CacheJail.php
@@ -239,7 +239,7 @@ class CacheJail extends CacheWrapper {
* get the size of a folder and set it in the cache
*
* @param string $path
- * @param array $entry (optional) meta data of the folder
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
* @return int
*/
public function calculateFolderSize($path, $entry = null) {
diff --git a/lib/private/Files/Cache/Wrapper/CacheWrapper.php b/lib/private/Files/Cache/Wrapper/CacheWrapper.php
index 2cd378ad23c..c1043fbc6fb 100644
--- a/lib/private/Files/Cache/Wrapper/CacheWrapper.php
+++ b/lib/private/Files/Cache/Wrapper/CacheWrapper.php
@@ -249,7 +249,7 @@ class CacheWrapper extends Cache {
* get the size of a folder and set it in the cache
*
* @param string $path
- * @param array $entry (optional) meta data of the folder
+ * @param array|null|ICacheEntry $entry (optional) meta data of the folder
* @return int
*/
public function calculateFolderSize($path, $entry = null) {