diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 61283bef5f..8f86deeea4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -6819,12 +6819,6 @@ parameters: count: 1 path: src/Dbal/DatabaseInterface.php - - - message: '#^Foreach overwrites \$database with its value variable\.$#' - identifier: foreach.valueOverwrite - count: 1 - path: src/Dbal/DatabaseInterface.php - - message: '#^Foreach overwrites \$table with its value variable\.$#' identifier: foreach.valueOverwrite diff --git a/src/Dbal/DatabaseInterface.php b/src/Dbal/DatabaseInterface.php index 23e117a8e1..be7d1572ce 100644 --- a/src/Dbal/DatabaseInterface.php +++ b/src/Dbal/DatabaseInterface.php @@ -748,19 +748,19 @@ class DatabaseInterface * returns detailed array with all columns for given table in database, * or all tables/databases * - * @param string|null $database name of database + * @param string $database name of database * @param string|null $table name of table to retrieve columns from * * @return mixed[] */ public function getColumnsFull( - string|null $database = null, + string $database, string|null $table = null, ConnectionType $connectionType = ConnectionType::User, ): array { if (! $this->config->selectedServer['DisableIS']) { $sql = QueryGenerator::getInformationSchemaColumnsFullRequest( - $database !== null ? $this->quoteString($database, $connectionType) : null, + $this->quoteString($database, $connectionType), $table !== null ? $this->quoteString($table, $connectionType) : null, null, ); @@ -770,13 +770,6 @@ class DatabaseInterface } $columns = []; - if ($database === null) { - foreach ($this->getDatabaseList() as $database) { - $columns[$database] = $this->getColumnsFull($database, null, $connectionType); - } - - return $columns; - } if ($table === null) { $tables = $this->getTables($database);