From 61bcfa4d6a7bca1117ba4b1a6b2bf0d8e8308cd7 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 1 Jul 2024 21:48:15 +0700 Subject: [PATCH 1/2] Fix fatal error caused by wrong return type in sparkle update length Signed-off-by: Claudio Cambra --- src/Response.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Response.php b/src/Response.php index 38ca5c5..9a07305 100644 --- a/src/Response.php +++ b/src/Response.php @@ -126,7 +126,7 @@ private function getSparkleUpdateSignature(array $updateVersion) : string { return $updateVersion[$updateSignatureKey]; } - private function getSparkleUpdateLength(array $updateVersion) : string { + private function getSparkleUpdateLength(array $updateVersion) : int { $updateLengthKey = $this->isFileProvider ? 'fileProviderLength' : 'length'; return $updateVersion[$updateLengthKey]; } From 6a61f1c3260bcf6733cc52cc8fe6e26ff6702dbb Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 1 Jul 2024 22:29:44 +0700 Subject: [PATCH 2/2] Use ints for sparkle length in mock config Signed-off-by: Claudio Cambra --- tests/unit/ResponseTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/ResponseTest.php b/tests/unit/ResponseTest.php index 7065826..715bd0b 100644 --- a/tests/unit/ResponseTest.php +++ b/tests/unit/ResponseTest.php @@ -48,7 +48,7 @@ public function updateDataProvider(): array 'downloadurl' => 'https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg', 'sparkleDownloadUrl' => 'https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz', 'signature' => 'MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=', - 'length' => '62738920', + 'length' => 62738920, ] ], 'beta' => [ @@ -71,7 +71,7 @@ public function updateDataProvider(): array 'downloadurl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc2.pkg', 'sparkleDownloadUrl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz', 'signature' => 'MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=', - 'length' => '62738920', + 'length' => 62738920, ] ], 'daily' => [