diff --git a/src/Contracts/StorageService.php b/src/Contracts/StorageService.php index 7d3002e..633434d 100644 --- a/src/Contracts/StorageService.php +++ b/src/Contracts/StorageService.php @@ -31,7 +31,7 @@ interface StorageService public function getFile(StorageFilePath $filePath): ?FileStream; - public function remove(StorageFilePath $filePath): void; + public function remove(StorageFilePath $filePath): bool; - public function removeFromDisk(StorageFilePath $filePath, DiskName $disk): void; + public function removeFromDisk(StorageFilePath $filePath, DiskName $disk): bool; } diff --git a/src/Facades/StorageService.php b/src/Facades/StorageService.php index 2e8b840..7268654 100644 --- a/src/Facades/StorageService.php +++ b/src/Facades/StorageService.php @@ -16,8 +16,8 @@ use Uwil\Storage\Contracts\StorageService as StorageServiceContract; * @method static bool fileExists(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath) * @method static bool fileExistsOnDisk(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath, \Uwil\Storage\Lib\ValueObjects\DiskName $disk) * @method static \Uwil\Storage\Lib\ValueObjects\FileStream|null getFile(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath) - * @method static void remove(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath) - * @method static void removeFromDisk(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath, \Uwil\Storage\Lib\ValueObjects\DiskName $disk) + * @method static bool remove(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath) + * @method static bool removeFromDisk(\Uwil\Storage\Lib\ValueObjects\StorageFilePath $filePath, \Uwil\Storage\Lib\ValueObjects\DiskName $disk) * * @see \Uwil\Storage\Contracts\StorageService * @see \Uwil\Storage\Lib\StorageServiceImpl diff --git a/src/Lib/StorageServiceImpl.php b/src/Lib/StorageServiceImpl.php index 7d9e830..e2a1359 100644 --- a/src/Lib/StorageServiceImpl.php +++ b/src/Lib/StorageServiceImpl.php @@ -83,16 +83,18 @@ readonly class StorageServiceImpl implements StorageService } #[\Override] - public function remove(StorageFilePath $filePath): void + + #[\Override] + public function remove(StorageFilePath $filePath): bool { $defaultDisk = $this->config->getDefaultDisk(); - $this->gateway->deleteFile($defaultDisk, $filePath); + return $this->gateway->deleteFile($defaultDisk, $filePath); } #[\Override] - public function removeFromDisk(StorageFilePath $filePath, DiskName $disk): void + public function removeFromDisk(StorageFilePath $filePath, DiskName $disk): bool { - $this->gateway->deleteFile($disk, $filePath); + return $this->gateway->deleteFile($disk, $filePath); } }