Skip to content

Commit e94a5fd

Browse files
committed
Fix psalm issues
1 parent 84a115c commit e94a5fd

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/Driver/Pdo/AbstractPdoConnection.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
use function array_keys;
2727
use function is_string;
28+
use function method_exists;
2829

2930
/**
3031
* Represents a connection to a database using the PDO (PHP Data Objects) extension.
@@ -201,7 +202,9 @@ public function setEmulatePrepare(bool $value): void
201202
public function setTablePrefix(string $value): void
202203
{
203204
parent::setTablePrefix($value);
204-
$this->quoter?->setTablePrefix($value);
205+
if ($this->quoter !== null && method_exists($this->quoter, 'setTablePrefix')) {
206+
$this->quoter->setTablePrefix($value);
207+
}
205208
}
206209

207210
/**

src/Schema/AbstractSchema.php

+9-4
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,8 @@ public function refresh(): void
342342
*/
343343
public function refreshTableSchema(string $name): void
344344
{
345-
$rawName = $this->db->getQuoter()->getRawTableName($name);
345+
/** @psalm-suppress DeprecatedMethod */
346+
$rawName = $this->getRawTableName($name);
346347

347348
unset($this->tableMetadata[$rawName]);
348349

@@ -472,7 +473,8 @@ protected function getSchemaMetadata(string $schema, string $type, bool $refresh
472473
*/
473474
protected function getTableMetadata(string $name, string $type, bool $refresh = false): mixed
474475
{
475-
$rawName = $this->db->getQuoter()->getRawTableName($name);
476+
/** @psalm-suppress DeprecatedMethod */
477+
$rawName = $this->getRawTableName($name);
476478

477479
if (!isset($this->tableMetadata[$rawName])) {
478480
$this->loadTableMetadataFromCache($rawName);
@@ -572,8 +574,11 @@ protected function resolveTableName(string $name): TableSchemaInterface
572574
*/
573575
protected function setTableMetadata(string $name, string $type, mixed $data): void
574576
{
575-
/** @psalm-suppress MixedArrayAssignment */
576-
$this->tableMetadata[$this->db->getQuoter()->getRawTableName($name)][$type] = $data;
577+
/**
578+
* @psalm-suppress MixedArrayAssignment
579+
* @psalm-suppress DeprecatedMethod
580+
*/
581+
$this->tableMetadata[$this->getRawTableName($name)][$type] = $data;
577582
}
578583

579584
/**

0 commit comments

Comments
 (0)