18 lines
536 B
PHP
18 lines
536 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Exceptions\Helpers;
|
|
|
|
class FileStorageOperationException extends \RuntimeException
|
|
{
|
|
public static function copyFailed(string $sourcePath, string $destinationPath): self
|
|
{
|
|
return new self(sprintf('Failed to copy file %s to %s', $sourcePath, $destinationPath));
|
|
}
|
|
|
|
public static function cannotGenerateUniqueFilename(string $folderPath, string $filename): self
|
|
{
|
|
return new self("Failed to have a unique filename for {$folderPath}/{$filename}");
|
|
}
|
|
}
|