1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-22 12:31:15 +01:00

rm legacy

This commit is contained in:
Daniil Gentili 2023-05-02 18:57:23 +02:00
parent 6f5dec19ec
commit cbae5b35fd
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7
5 changed files with 4 additions and 23 deletions

View File

@ -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 = [];
}

View File

@ -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);

View File

@ -22,9 +22,6 @@ use PDO;
*/
class MysqlArray extends SqlArray
{
// Legacy
protected array $settings;
/**
* Initialize on startup.
*/

View File

@ -23,9 +23,6 @@ use PDO;
*/
class PostgresArray extends SqlArray
{
// Legacy
protected array $settings;
/**
* Prepare statements.
*

View File

@ -23,9 +23,6 @@ class RedisArray extends DriverArray
{
private RedisRedis $db;
// Legacy
protected array $settings;
/**
* Initialize on startup.
*/