diff --git a/index.php b/index.php index 2d630209..b4166ef0 100644 --- a/index.php +++ b/index.php @@ -27,9 +27,6 @@ class LogException extends \Exception { } -use Closure; -use CurlHandle; - class Updater { /** @var int */ public const LAST_STEP = 12; @@ -51,7 +48,7 @@ class Updater { private int $previousProgress = 0; - private ?Closure $downloadProgress = null; + private ?\Closure $downloadProgress = null; /** * Updater constructor @@ -617,7 +614,7 @@ private function getUpdateServerResponse(): array { * * @throws \Exception */ - public function downloadUpdate(string $url = '', ?Closure $downloadProgress = null): void { + public function downloadUpdate(string $url = '', ?\Closure $downloadProgress = null): void { $this->silentLog('[info] downloadUpdate()'); $this->downloadProgress = $downloadProgress; @@ -694,7 +691,7 @@ private function getDownloadURLs(): array { } - private function getCurl(string $url): CurlHandle { + private function getCurl(string $url): \CurlHandle { $ch = curl_init($url); if ($ch === false) { throw new \Exception('Fail to open cUrl handler'); @@ -773,7 +770,7 @@ private function isAbleToDecompress(string $ext): bool { return $ext === 'zip' && extension_loaded($ext); } - private function downloadProgressCallback(CurlHandle $resource, int $download_size, int $downloaded): void { + private function downloadProgressCallback(\CurlHandle $resource, int $download_size, int $downloaded): void { if ($download_size !== 0) { $progress = (int)round($downloaded * 100 / $download_size); if ($progress > $this->previousProgress) { diff --git a/lib/Updater.php b/lib/Updater.php index 9a915277..d7a61cab 100644 --- a/lib/Updater.php +++ b/lib/Updater.php @@ -9,9 +9,6 @@ namespace NC\Updater; -use Closure; -use CurlHandle; - class Updater { /** @var int */ public const LAST_STEP = 12; @@ -33,7 +30,7 @@ class Updater { private int $previousProgress = 0; - private ?Closure $downloadProgress = null; + private ?\Closure $downloadProgress = null; /** * Updater constructor @@ -599,7 +596,7 @@ private function getUpdateServerResponse(): array { * * @throws \Exception */ - public function downloadUpdate(string $url = '', ?Closure $downloadProgress = null): void { + public function downloadUpdate(string $url = '', ?\Closure $downloadProgress = null): void { $this->silentLog('[info] downloadUpdate()'); $this->downloadProgress = $downloadProgress; @@ -676,7 +673,7 @@ private function getDownloadURLs(): array { } - private function getCurl(string $url): CurlHandle { + private function getCurl(string $url): \CurlHandle { $ch = curl_init($url); if ($ch === false) { throw new \Exception('Fail to open cUrl handler'); @@ -755,7 +752,7 @@ private function isAbleToDecompress(string $ext): bool { return $ext === 'zip' && extension_loaded($ext); } - private function downloadProgressCallback(CurlHandle $resource, int $download_size, int $downloaded): void { + private function downloadProgressCallback(\CurlHandle $resource, int $download_size, int $downloaded): void { if ($download_size !== 0) { $progress = (int)round($downloaded * 100 / $download_size); if ($progress > $this->previousProgress) { diff --git a/updater.phar b/updater.phar index b851fb5c..74502472 100755 Binary files a/updater.phar and b/updater.phar differ