mirror of
https://github.com/danog/MadelineProto.git
synced 2025-01-22 12:31:15 +01:00
rm legacy
This commit is contained in:
parent
6f5dec19ec
commit
cbae5b35fd
@ -16,8 +16,10 @@ use InvalidArgumentException;
|
||||
/**
|
||||
* @psalm-import-type TOrmConfig from DbPropertiesTrait
|
||||
* This factory class initializes the correct database backend for MadelineProto.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
abstract class DbPropertiesFactory
|
||||
final class DbPropertiesFactory
|
||||
{
|
||||
/**
|
||||
* @param TOrmConfig|'array' $config
|
||||
@ -30,6 +32,7 @@ abstract class DbPropertiesFactory
|
||||
*/
|
||||
public static function get(DatabaseAbstract $dbSettings, string $table, string|array $config, ?DbType $value = null)
|
||||
{
|
||||
// Legacy
|
||||
if ($config === 'array') {
|
||||
$config = [];
|
||||
}
|
||||
|
@ -192,19 +192,6 @@ abstract class DriverArray implements DbArray, IteratorAggregate
|
||||
return ['table', 'dbSettings'];
|
||||
}
|
||||
|
||||
public function __wakeup(): void
|
||||
{
|
||||
if (isset($this->settings) && \is_array($this->settings)) {
|
||||
$clazz = (new ReflectionClass($this))->getProperty('dbSettings')->getType()->getName();
|
||||
/**
|
||||
* @var SettingsAbstract
|
||||
* @psalm-suppress UndefinedThisPropertyAssignment
|
||||
*/
|
||||
$this->dbSettings = new $clazz;
|
||||
$this->dbSettings->mergeArray($this->settings);
|
||||
unset($this->settings);
|
||||
}
|
||||
}
|
||||
final public function offsetExists($index): bool
|
||||
{
|
||||
return $this->isset($index);
|
||||
|
@ -22,9 +22,6 @@ use PDO;
|
||||
*/
|
||||
class MysqlArray extends SqlArray
|
||||
{
|
||||
// Legacy
|
||||
protected array $settings;
|
||||
|
||||
/**
|
||||
* Initialize on startup.
|
||||
*/
|
||||
|
@ -23,9 +23,6 @@ use PDO;
|
||||
*/
|
||||
class PostgresArray extends SqlArray
|
||||
{
|
||||
// Legacy
|
||||
protected array $settings;
|
||||
|
||||
/**
|
||||
* Prepare statements.
|
||||
*
|
||||
|
@ -23,9 +23,6 @@ class RedisArray extends DriverArray
|
||||
{
|
||||
private RedisRedis $db;
|
||||
|
||||
// Legacy
|
||||
protected array $settings;
|
||||
|
||||
/**
|
||||
* Initialize on startup.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user