Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class LogException extends \Exception {
}


use Closure;
use CurlHandle;

class Updater {
/** @var int */
public const LAST_STEP = 12;
Expand All @@ -51,7 +48,7 @@ class Updater {

private int $previousProgress = 0;

private ?Closure $downloadProgress = null;
private ?\Closure $downloadProgress = null;

/**
* Updater constructor
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down
11 changes: 4 additions & 7 deletions lib/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@

namespace NC\Updater;

use Closure;
use CurlHandle;

class Updater {
/** @var int */
public const LAST_STEP = 12;
Expand All @@ -33,7 +30,7 @@ class Updater {

private int $previousProgress = 0;

private ?Closure $downloadProgress = null;
private ?\Closure $downloadProgress = null;

/**
* Updater constructor
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down
Binary file modified updater.phar
Binary file not shown.