diff --git a/CHANGELOG.md b/CHANGELOG.md index 3281310b3..d5b56f413 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Enh #801: Deprecate `AbstractSchema::normalizeRowKeyCase()` method (@Tigrov) - Enh #801: Deprecate `SchemaInterface::getRawTableName()` and add `QuoterInterface::getRawTableName()` method (@Tigrov) - Enh #801: Deprecate `SchemaInterface::isReadQuery()` and add `DbStringHelper::isReadQuery()` method (@Tigrov) +- Enh #801: Remove unnecessary symbol `\\` from `rtrim()` function inside `DbStringHelper::baseName()` method (@Tigrov) ## 1.2.0 November 12, 2023 diff --git a/src/Schema/AbstractSchema.php b/src/Schema/AbstractSchema.php index 9b396c286..0e0ba1de2 100644 --- a/src/Schema/AbstractSchema.php +++ b/src/Schema/AbstractSchema.php @@ -144,6 +144,7 @@ public function getDataType(mixed $data): int }; } + /** @deprecated Use {@see QuoterInterface::getRawTableName()}. Will be removed in version 2.0.0. */ public function getRawTableName(string $name): string { if (str_contains($name, '{{')) { @@ -315,6 +316,7 @@ public function getTableUniques(string $name, bool $refresh = false): array return is_array($tableUniques) ? $tableUniques : []; } + /** @deprecated Use {@see DbStringHelper::isReadQuery()}. Will be removed in version 2.0.0. */ public function isReadQuery(string $sql): bool { $pattern = '/^\s*(SELECT|SHOW|DESCRIBE)\b/i'; @@ -340,7 +342,7 @@ public function refresh(): void */ public function refreshTableSchema(string $name): void { - $rawName = $this->getRawTableName($name); + $rawName = $this->db->getQuoter()->getRawTableName($name); unset($this->tableMetadata[$rawName]); @@ -470,7 +472,7 @@ protected function getSchemaMetadata(string $schema, string $type, bool $refresh */ protected function getTableMetadata(string $name, string $type, bool $refresh = false): mixed { - $rawName = $this->getRawTableName($name); + $rawName = $this->db->getQuoter()->getRawTableName($name); if (!isset($this->tableMetadata[$rawName])) { $this->loadTableMetadataFromCache($rawName); @@ -571,7 +573,7 @@ protected function resolveTableName(string $name): TableSchemaInterface protected function setTableMetadata(string $name, string $type, mixed $data): void { /** @psalm-suppress MixedArrayAssignment */ - $this->tableMetadata[$this->getRawTableName($name)][$type] = $data; + $this->tableMetadata[$this->db->getQuoter()->getRawTableName($name)][$type] = $data; } /** diff --git a/src/Schema/SchemaInterface.php b/src/Schema/SchemaInterface.php index 744ebc555..9582da1c1 100644 --- a/src/Schema/SchemaInterface.php +++ b/src/Schema/SchemaInterface.php @@ -285,7 +285,7 @@ public function getDataType(mixed $data): int; * * @return string The real name of the given table name. * - * @deprecated Use {@see Quoter::getRawTableName()}. Will be removed in version 2.0.0. + * @deprecated Use {@see QuoterInterface::getRawTableName()}. Will be removed in version 2.0.0. */ public function getRawTableName(string $name): string;