mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 06:39:01 +01:00
Move legacy classes
This commit is contained in:
parent
2d03f871ee
commit
0dce27db79
48
src/Db/CachedArray.php
Normal file
48
src/Db/CachedArray.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace danog\MadelineProto\Db;
|
||||||
|
|
||||||
|
use AssertionError;
|
||||||
|
use danog\AsyncOrm\DbArray;
|
||||||
|
use danog\AsyncOrm\DbArrayBuilder;
|
||||||
|
use danog\AsyncOrm\Internal\Containers\CacheContainer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
* @deprecated Please use https://github.com/danog/AsyncOrm
|
||||||
|
*/
|
||||||
|
final class CachedArray extends DbArray
|
||||||
|
{
|
||||||
|
private readonly CacheContainer $cache;
|
||||||
|
|
||||||
|
public function unset(string|int $key): void
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function set(string|int $key, mixed $value): void
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function get(string|int $key): mixed
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function clear(): void
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function getIterator(): \Traversable
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getInstance(DbArrayBuilder $config, DbArray|null $previous): DbArray
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
45
src/Db/MemoryArray.php
Normal file
45
src/Db/MemoryArray.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace danog\MadelineProto\Db;
|
||||||
|
|
||||||
|
use ArrayObject;
|
||||||
|
use AssertionError;
|
||||||
|
use danog\AsyncOrm\DbArray;
|
||||||
|
use danog\AsyncOrm\DbArrayBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
* @deprecated Please use https://github.com/danog/AsyncOrm
|
||||||
|
*/
|
||||||
|
final class MemoryArray extends ArrayObject
|
||||||
|
{
|
||||||
|
public function unset(string|int $key): void
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function set(string|int $key, mixed $value): void
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function get(string|int $key): mixed
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function clear(): void
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function count(): int
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
public function getIterator(): \Iterator
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getInstance(DbArrayBuilder $config, DbArray|null $previous): DbArray
|
||||||
|
{
|
||||||
|
throw new AssertionError("Unreachable");
|
||||||
|
}
|
||||||
|
}
|
@ -6,10 +6,6 @@ if (class_exists('\\danog\\MadelineProto\\Db\\NullCache\\MysqlArray')) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
use ArrayObject;
|
|
||||||
use AssertionError;
|
|
||||||
use danog\AsyncOrm\DbArray;
|
|
||||||
use danog\AsyncOrm\DbArrayBuilder;
|
|
||||||
use danog\AsyncOrm\Internal\Containers\CacheContainer;
|
use danog\AsyncOrm\Internal\Containers\CacheContainer;
|
||||||
use danog\AsyncOrm\Internal\Driver\MysqlArray;
|
use danog\AsyncOrm\Internal\Driver\MysqlArray;
|
||||||
use danog\AsyncOrm\Internal\Driver\PostgresArray;
|
use danog\AsyncOrm\Internal\Driver\PostgresArray;
|
||||||
@ -25,77 +21,6 @@ class_alias(PostgresArray::class, '\\danog\\MadelineProto\\Db\\PostgresArrayByte
|
|||||||
class_alias(RedisArray::class, '\\danog\\MadelineProto\\Db\\RedisArray');
|
class_alias(RedisArray::class, '\\danog\\MadelineProto\\Db\\RedisArray');
|
||||||
class_alias(CacheContainer::class, '\\danog\\MadelineProto\\Db\\CacheContainer');
|
class_alias(CacheContainer::class, '\\danog\\MadelineProto\\Db\\CacheContainer');
|
||||||
|
|
||||||
/** @deprecated */
|
|
||||||
final class MemoryArray extends ArrayObject
|
|
||||||
{
|
|
||||||
public function unset(string|int $key): void
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function set(string|int $key, mixed $value): void
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function get(string|int $key): mixed
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function clear(): void
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function count(): int
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function getIterator(): \Iterator
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getInstance(DbArrayBuilder $config, DbArray|null $previous): DbArray
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/** @deprecated */
|
|
||||||
final class CachedArray extends DbArray
|
|
||||||
{
|
|
||||||
|
|
||||||
private readonly CacheContainer $cache;
|
|
||||||
|
|
||||||
public function unset(string|int $key): void
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function set(string|int $key, mixed $value): void
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function get(string|int $key): mixed
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function clear(): void
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function count(): int
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
public function getIterator(): \Traversable
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function getInstance(DbArrayBuilder $config, DbArray|null $previous): DbArray
|
|
||||||
{
|
|
||||||
throw new AssertionError("Unreachable");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((PHP_MINOR_VERSION === 2 && PHP_VERSION_ID < 80204)
|
if ((PHP_MINOR_VERSION === 2 && PHP_VERSION_ID < 80204)
|
||||||
|| PHP_MAJOR_VERSION < 8
|
|| PHP_MAJOR_VERSION < 8
|
||||||
|| (PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 2)
|
|| (PHP_MAJOR_VERSION === 8 && PHP_MINOR_VERSION < 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user