-
-
Notifications
You must be signed in to change notification settings - Fork 283
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more strict parameter for GeolocationDbUpdater
- Loading branch information
Showing
6 changed files
with
110 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
module/Core/src/Geolocation/GeolocationDownloadProgressHandlerInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Shlinkio\Shlink\Core\Geolocation; | ||
|
||
interface GeolocationDownloadProgressHandlerInterface | ||
{ | ||
/** | ||
* Invoked right before starting to download a geolocation DB file, and only if it needs to be downloaded. | ||
* @param $olderDbExists - Indicates if an older DB file already exists when this method is called | ||
*/ | ||
public function beforeDownload(bool $olderDbExists): void; | ||
|
||
/** | ||
* Invoked every time a new chunk of the new DB file is downloaded, with the total size of the file and how much has | ||
* already been downloaded. | ||
* @param $olderDbExists - Indicates if an older DB file already exists when this method is called | ||
*/ | ||
public function handleProgress(int $total, int $downloaded, bool $olderDbExists): void; | ||
} |