diff --git a/composer.json b/composer.json index ab767ec..d7855c6 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,8 @@ "composer/composer": "^2.7.1", "doctrine/collections": "^1.8.0", "guzzlehttp/guzzle": "~7.0", - "ext-json": "*" + "ext-json": "*", + "beberlei/assert": "^3.3" }, "require-dev": { "phpunit/phpunit": "^9.3", diff --git a/src/Exceptions/BaseException.php b/src/Exceptions/BaseException.php index 5af096d..908200d 100644 --- a/src/Exceptions/BaseException.php +++ b/src/Exceptions/BaseException.php @@ -19,7 +19,7 @@ namespace D3\KlicktippPhpClient\Exceptions; use Exception; -class BaseException extends Exception +class BaseException extends Exception implements KlicktippExceptionInterface { public function __construct($message = "", $code = 0, Exception $previous = null) { diff --git a/src/Exceptions/InvalidCredentialTypeException.php b/src/Exceptions/InvalidCredentialTypeException.php new file mode 100644 index 0000000..ba602f2 --- /dev/null +++ b/src/Exceptions/InvalidCredentialTypeException.php @@ -0,0 +1,24 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +namespace D3\KlicktippPhpClient\Exceptions; + +use Assert\LazyAssertionException; + +class InvalidCredentialTypeException extends LazyAssertionException implements KlicktippExceptionInterface +{ +} diff --git a/src/Exceptions/KlicktippExceptionInterface.php b/src/Exceptions/KlicktippExceptionInterface.php new file mode 100644 index 0000000..fdec70b --- /dev/null +++ b/src/Exceptions/KlicktippExceptionInterface.php @@ -0,0 +1,20 @@ + + * @link https://www.oxidmodule.com + */ + +declare(strict_types=1); + +namespace D3\KlicktippPhpClient\Exceptions; + +interface KlicktippExceptionInterface {} \ No newline at end of file diff --git a/src/Exceptions/NoCredentialsException.php b/src/Exceptions/NoCredentialsException.php index 59c5a09..cfb5125 100644 --- a/src/Exceptions/NoCredentialsException.php +++ b/src/Exceptions/NoCredentialsException.php @@ -17,6 +17,8 @@ declare(strict_types=1); namespace D3\KlicktippPhpClient\Exceptions; -class NoCredentialsException extends BaseException +use Assert\LazyAssertionException; + +class NoCredentialsException extends LazyAssertionException implements KlicktippExceptionInterface { }