improve exceptions

This commit is contained in:
Daniel Seifert 2025-01-07 13:56:51 +01:00
parent 3911584ea7
commit c18c7fb3db
5 changed files with 50 additions and 3 deletions

View File

@ -20,7 +20,8 @@
"composer/composer": "^2.7.1", "composer/composer": "^2.7.1",
"doctrine/collections": "^1.8.0", "doctrine/collections": "^1.8.0",
"guzzlehttp/guzzle": "~7.0", "guzzlehttp/guzzle": "~7.0",
"ext-json": "*" "ext-json": "*",
"beberlei/assert": "^3.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.3", "phpunit/phpunit": "^9.3",

View File

@ -19,7 +19,7 @@ namespace D3\KlicktippPhpClient\Exceptions;
use Exception; use Exception;
class BaseException extends Exception class BaseException extends Exception implements KlicktippExceptionInterface
{ {
public function __construct($message = "", $code = 0, Exception $previous = null) public function __construct($message = "", $code = 0, Exception $previous = null)
{ {

View File

@ -0,0 +1,24 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\KlicktippPhpClient\Exceptions;
use Assert\LazyAssertionException;
class InvalidCredentialTypeException extends LazyAssertionException implements KlicktippExceptionInterface
{
}

View File

@ -0,0 +1,20 @@
<?php
/**
* Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\KlicktippPhpClient\Exceptions;
interface KlicktippExceptionInterface {}

View File

@ -17,6 +17,8 @@ declare(strict_types=1);
namespace D3\KlicktippPhpClient\Exceptions; namespace D3\KlicktippPhpClient\Exceptions;
class NoCredentialsException extends BaseException use Assert\LazyAssertionException;
class NoCredentialsException extends LazyAssertionException implements KlicktippExceptionInterface
{ {
} }