Upload beautify
This commit is contained in:
42
app/Uploads/Exceptions/DraftQuotaException.php
Normal file
42
app/Uploads/Exceptions/DraftQuotaException.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Uploads\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class DraftQuotaException extends RuntimeException
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $machineCode,
|
||||
private readonly int $httpStatus,
|
||||
) {
|
||||
parent::__construct($machineCode);
|
||||
}
|
||||
|
||||
public function machineCode(): string
|
||||
{
|
||||
return $this->machineCode;
|
||||
}
|
||||
|
||||
public function httpStatus(): int
|
||||
{
|
||||
return $this->httpStatus;
|
||||
}
|
||||
|
||||
public static function draftLimit(): self
|
||||
{
|
||||
return new self('draft_limit', 429);
|
||||
}
|
||||
|
||||
public static function storageLimit(): self
|
||||
{
|
||||
return new self('storage_limit', 413);
|
||||
}
|
||||
|
||||
public static function duplicateUpload(): self
|
||||
{
|
||||
return new self('duplicate_upload', 422);
|
||||
}
|
||||
}
|
||||
11
app/Uploads/Exceptions/UploadNotFoundException.php
Normal file
11
app/Uploads/Exceptions/UploadNotFoundException.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Uploads\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class UploadNotFoundException extends RuntimeException
|
||||
{
|
||||
}
|
||||
11
app/Uploads/Exceptions/UploadOwnershipException.php
Normal file
11
app/Uploads/Exceptions/UploadOwnershipException.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Uploads\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class UploadOwnershipException extends RuntimeException
|
||||
{
|
||||
}
|
||||
11
app/Uploads/Exceptions/UploadPublishValidationException.php
Normal file
11
app/Uploads/Exceptions/UploadPublishValidationException.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Uploads\Exceptions;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
final class UploadPublishValidationException extends RuntimeException
|
||||
{
|
||||
}
|
||||
Reference in New Issue
Block a user