Skip to content

Commit

Permalink
Move quoter->setTablePrefix() to AbstractPdoConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jan 30, 2024
1 parent 277c97e commit 7042f71
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/Connection/AbstractConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Yiisoft\Db\Query\BatchQueryResult;
use Yiisoft\Db\Query\BatchQueryResultInterface;
use Yiisoft\Db\Query\QueryInterface;
use Yiisoft\Db\Schema\QuoterInterface;
use Yiisoft\Db\Schema\TableSchemaInterface;
use Yiisoft\Db\Transaction\TransactionInterface;

Expand All @@ -22,7 +21,6 @@
abstract class AbstractConnection implements ConnectionInterface
{
protected TransactionInterface|null $transaction = null;
protected QuoterInterface|null $quoter = null;
private bool $enableSavepoint = true;
private string $tablePrefix = '';

Expand Down Expand Up @@ -73,7 +71,6 @@ public function setEnableSavepoint(bool $value): void
public function setTablePrefix(string $value): void
{
$this->tablePrefix = $value;
$this->quoter?->setTablePrefix($value);
}

public function transaction(Closure $closure, string $isolationLevel = null): mixed
Expand Down
8 changes: 8 additions & 0 deletions src/Driver/Pdo/AbstractPdoConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Yiisoft\Db\Profiler\ProfilerAwareInterface;
use Yiisoft\Db\Profiler\ProfilerAwareTrait;
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface;
use Yiisoft\Db\Schema\QuoterInterface;
use Yiisoft\Db\Schema\SchemaInterface;
use Yiisoft\Db\Transaction\TransactionInterface;

Expand All @@ -44,6 +45,7 @@ abstract class AbstractPdoConnection extends AbstractConnection implements PdoCo
protected string $serverVersion = '';
protected bool|null $emulatePrepare = null;
protected QueryBuilderInterface|null $queryBuilder = null;
protected QuoterInterface|null $quoter = null;
protected SchemaInterface|null $schema = null;

public function __construct(protected PdoDriverInterface $driver, protected SchemaCache $schemaCache)
Expand Down Expand Up @@ -196,6 +198,12 @@ public function setEmulatePrepare(bool $value): void
$this->emulatePrepare = $value;
}

public function setTablePrefix(string $value): void

Check warning on line 201 in src/Driver/Pdo/AbstractPdoConnection.php

View check run for this annotation

Codecov / codecov/patch

src/Driver/Pdo/AbstractPdoConnection.php#L201

Added line #L201 was not covered by tests
{
$this->tablePrefix = $value;

Check failure on line 203 in src/Driver/Pdo/AbstractPdoConnection.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedThisPropertyAssignment

src/Driver/Pdo/AbstractPdoConnection.php:203:9: UndefinedThisPropertyAssignment: Instance property Yiisoft\Db\Driver\Pdo\AbstractPdoConnection::$tablePrefix is not defined (see https://psalm.dev/040)

Check failure on line 203 in src/Driver/Pdo/AbstractPdoConnection.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedThisPropertyAssignment

src/Driver/Pdo/AbstractPdoConnection.php:203:9: UndefinedThisPropertyAssignment: Instance property Yiisoft\Db\Driver\Pdo\AbstractPdoConnection::$tablePrefix is not defined (see https://psalm.dev/040)

Check failure on line 203 in src/Driver/Pdo/AbstractPdoConnection.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedThisPropertyAssignment

src/Driver/Pdo/AbstractPdoConnection.php:203:9: UndefinedThisPropertyAssignment: Instance property Yiisoft\Db\Driver\Pdo\AbstractPdoConnection::$tablePrefix is not defined (see https://psalm.dev/040)
$this->quoter?->setTablePrefix($value);

Check failure on line 204 in src/Driver/Pdo/AbstractPdoConnection.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.2-ubuntu-latest

UndefinedInterfaceMethod

src/Driver/Pdo/AbstractPdoConnection.php:204:25: UndefinedInterfaceMethod: Method Yiisoft\Db\Schema\QuoterInterface::setTablePrefix does not exist (see https://psalm.dev/181)

Check failure on line 204 in src/Driver/Pdo/AbstractPdoConnection.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedInterfaceMethod

src/Driver/Pdo/AbstractPdoConnection.php:204:25: UndefinedInterfaceMethod: Method Yiisoft\Db\Schema\QuoterInterface::setTablePrefix does not exist (see https://psalm.dev/181)

Check failure on line 204 in src/Driver/Pdo/AbstractPdoConnection.php

View workflow job for this annotation

GitHub Actions / psalm / PHP 8.1-ubuntu-latest

UndefinedInterfaceMethod

src/Driver/Pdo/AbstractPdoConnection.php:204:25: UndefinedInterfaceMethod: Method Yiisoft\Db\Schema\QuoterInterface::setTablePrefix does not exist (see https://psalm.dev/181)

Check warning on line 204 in src/Driver/Pdo/AbstractPdoConnection.php

View check run for this annotation

Codecov / codecov/patch

src/Driver/Pdo/AbstractPdoConnection.php#L203-L204

Added lines #L203 - L204 were not covered by tests
}

/**
* Initializes the DB connection.
*
Expand Down

0 comments on commit 7042f71

Please sign in to comment.