Skip to content

Commit 11c26ea

Browse files
committed
fix: Remove use CurlHandle statement
PHP is warning that "The use statement with non-compound name 'CurlHandle' has no effect". This makes the web updater fail to update when the warning is propagated. Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
1 parent fe4bd93 commit 11c26ea

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class LogException extends \Exception {
2828

2929

3030
use Closure;
31-
use CurlHandle;
3231

3332
class Updater {
3433
/** @var int */

lib/Updater.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
namespace NC\Updater;
1111

1212
use Closure;
13-
use CurlHandle;
1413

1514
class Updater {
1615
/** @var int */
@@ -674,7 +673,7 @@ private function getDownloadURLs(): array {
674673

675674
}
676675

677-
private function getCurl(string $url): CurlHandle {
676+
private function getCurl(string $url): \CurlHandle {
678677
$ch = curl_init($url);
679678
if ($ch === false) {
680679
throw new \Exception('Fail to open cUrl handler');
@@ -753,7 +752,7 @@ private function isAbleToDecompress(string $ext): bool {
753752
return $ext === 'zip' && extension_loaded($ext);
754753
}
755754

756-
private function downloadProgressCallback(CurlHandle $resource, int $download_size, int $downloaded): void {
755+
private function downloadProgressCallback(\CurlHandle $resource, int $download_size, int $downloaded): void {
757756
if ($download_size !== 0) {
758757
$progress = (int)round($downloaded * 100 / $download_size);
759758
if ($progress > $this->previousProgress) {

0 commit comments

Comments
 (0)