Initial xentral_oss_20.3.c9ffacf

This commit is contained in:
Alex
2021-05-21 08:49:41 +02:00
parent 5406e4a551
commit 34e5ac43d9
18884 changed files with 2109867 additions and 0 deletions
@@ -0,0 +1,7 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
class ConfigurationMissingException extends \RuntimeException implements TaxdooApiExceptionInterface
{
}
@@ -0,0 +1,16 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
class InvalidKeyException extends TaxdooFatalExcepion
{
/**
* @param string $key
*
* @return InvalidKeyException
*/
public static function fromKey($key)
{
return new self("Ungültiger key: {$key}");
}
}
@@ -0,0 +1,22 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
use Throwable;
class KeyNotFoundException extends TaxdooFatalExcepion
{
/**
* @param string $message
* @param int $code
* @param Throwable|null $previous
*/
public function __construct($message = '', $code = 0, Throwable $previous = null)
{
if (empty($message)) {
$message = 'Kein Zugangsschlüssel konfiguriert';
}
parent::__construct($message, $code, $previous);
}
}
@@ -0,0 +1,7 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
class TaxdooApiException extends \RuntimeException implements TaxdooApiExceptionInterface
{
}
@@ -0,0 +1,9 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
use Xentral\Core\Exception\ModuleExceptionInterface;
interface TaxdooApiExceptionInterface extends ModuleExceptionInterface
{
}
@@ -0,0 +1,10 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
use RuntimeException;
use Xentral\Core\Exception\ModuleExceptionInterface;
class TaxdooFatalExcepion extends RuntimeException implements ModuleExceptionInterface
{
}
@@ -0,0 +1,30 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
class TooManyReuestsException extends TaxdooFatalExcepion
{
/** @var int $remaining */
private $remaining;
/**
* @param int $timeout
*
* @return TooManyReuestsException
*/
public static function fromTimeout($timeout)
{
$e = new self("Too many requests ($timeout secs timeout)");
$e->remaining = $timeout;
return $e;
}
/**
* @return int
*/
public function getRemaining()
{
return $this->remaining;
}
}
@@ -0,0 +1,16 @@
<?php
namespace Xentral\Modules\TaxdooApi\Exception;
class UnsufficientPermissionException extends TaxdooFatalExcepion
{
/**
* @param string $key
*
* @return UnsufficientPermissionException
*/
public static function fromKey($key)
{
return new self("Nicht ausreichende Berechtigungen: {$key}");
}
}