mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Ensured required config options cannot be left empty
This commit is contained in:
10
module/Installer/src/Exception/ExceptionInterface.php
Normal file
10
module/Installer/src/Exception/ExceptionInterface.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Installer\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
interface ExceptionInterface extends Throwable
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Shlinkio\Shlink\Installer\Exception;
|
||||
|
||||
use RuntimeException;
|
||||
use function sprintf;
|
||||
|
||||
class MissingRequiredOptionException extends RuntimeException implements ExceptionInterface
|
||||
{
|
||||
public static function fromOption(string $optionName): self
|
||||
{
|
||||
return new self(sprintf('The "%s" is required and can\'t be empty', $optionName));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user