Initial commit

This commit is contained in:
2020-12-28 23:32:37 +01:00
commit 66b18a024d
56 changed files with 3881 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<?php
namespace Toalett\Redis\Timeseries\Exception;
use Throwable;
class DatabaseException extends RuntimeException
{
public function __construct($message = "", $code = 0, Throwable $previous = null)
{
$parts = explode(':', $message);
if (count($parts) >= 2) {
$message = ucfirst(trim(end($parts)));
}
parent::__construct($message, $code, $previous);
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace Toalett\Redis\Timeseries\Exception;
use InvalidArgumentException as PhpInvalidArgumentException;
class InvalidArgumentException extends PhpInvalidArgumentException
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace Toalett\Redis\Timeseries\Exception;
class KeyNotFoundException extends RuntimeException
{
public function __construct(string $key)
{
parent::__construct(sprintf("Key '{$key}' not found on Redis server"));
}
}

View File

@@ -0,0 +1,9 @@
<?php
namespace Toalett\Redis\Timeseries\Exception;
use RuntimeException as PhpRuntimeException;
class RuntimeException extends PhpRuntimeException
{
}