From 4c1003122d6c08a809e01b3a6ce49271533fd15b Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 1 Jul 2024 17:19:33 +0200 Subject: [PATCH] fix(db): `Doctrine\DBAL\Schema\Schema::getTableNames()` was removed Signed-off-by: Joas Schilling --- lib/private/DB/SchemaWrapper.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/private/DB/SchemaWrapper.php b/lib/private/DB/SchemaWrapper.php index 5720e10fbdb..59cc9e74312 100644 --- a/lib/private/DB/SchemaWrapper.php +++ b/lib/private/DB/SchemaWrapper.php @@ -8,6 +8,7 @@ namespace OC\DB; use Doctrine\DBAL\Exception; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Schema\Schema; +use Doctrine\DBAL\Schema\Table; use OCP\DB\ISchemaWrapper; class SchemaWrapper implements ISchemaWrapper { @@ -43,26 +44,25 @@ class SchemaWrapper implements ISchemaWrapper { /** * Gets all table names * - * @return array + * @return list */ - public function getTableNamesWithoutPrefix() { - $tableNames = $this->schema->getTableNames(); - return array_map(function ($tableName) { + public function getTableNamesWithoutPrefix(): array { + return array_map(function (string $tableName) { if (str_starts_with($tableName, $this->connection->getPrefix())) { return substr($tableName, strlen($this->connection->getPrefix())); } return $tableName; - }, $tableNames); + }, $this->getTableNames()); } // Overwritten methods /** - * @return array + * @return list */ - public function getTableNames() { - return $this->schema->getTableNames(); + public function getTableNames(): array { + return array_map(static fn (Table $table) => $table->getName(), $this->schema->getTables()); } /**