| Total Complexity | 7 |
| Total Lines | 40 |
| Duplicated Lines | 0 % |
| Coverage | 84.62% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class GeoDataImporter |
||
| 9 | { |
||
| 10 | protected FilesystemStorage $storage; |
||
| 11 | |||
| 12 | 2 | public function __construct(Container $app) |
|
| 15 | 2 | } |
|
| 16 | |||
| 17 | 2 | public function storeFileFromUrl(string $url, ?string $name, ?\Closure $progressCallback = null, bool $force = false): bool |
|
| 18 | { |
||
| 19 | 2 | if (!($exists = $this->storage->exists($name)) || $force) { |
|
|
|
|||
| 20 | 2 | if ($exists) { |
|
| 21 | 1 | $this->storage->delete($name); |
|
| 22 | } |
||
| 23 | |||
| 24 | 2 | return $this->storage->storeFromUrl($url, $name, $progressCallback); |
|
| 25 | } |
||
| 26 | |||
| 27 | 1 | return false; |
|
| 28 | } |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @param string $file |
||
| 32 | * |
||
| 33 | * @return bool |
||
| 34 | * @throws \Exception |
||
| 35 | */ |
||
| 36 | public function extractFile(string $file): bool |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @return bool |
||
| 43 | * @throws \Exception |
||
| 44 | */ |
||
| 45 | 2 | public function truncateStorage(): bool |
|
| 48 | } |
||
| 49 | } |
||
| 50 |