Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated APIs #4831

Merged
merged 9 commits into from
Oct 2, 2021
Prev Previous commit
Next Next commit
Remove Schema::getTableNames()
  • Loading branch information
morozov committed Sep 30, 2021
commit 49ee93c3bf890168ca4e8bb9689adef7bea97263
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ awareness about deprecated code.

# Upgrade to 4.0

## BC BREAK: Removed `Schema::getTableNames()`.

The `Schema::getTableNames()` method has been removed.

## BC BREAK: Changes in `Schema` method return values.

The `Schema::getNamespaces()`, `Schema::getTables()` and `Schema::getSequences()` methods will return numeric arrays
Expand Down
21 changes: 0 additions & 21 deletions src/Schema/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Doctrine\DBAL\Schema\Visitor\Visitor;
use Doctrine\Deprecations\Deprecation;

use function array_keys;
use function array_values;
use function strpos;
use function strtolower;
Expand Down Expand Up @@ -237,26 +236,6 @@ public function hasTable(string $name): bool
return isset($this->_tables[$name]);
}

/**
* Gets all table names, prefixed with a schema name, even the default one if present.
*
* @deprecated Use {@link getTables()} and {@link Table::getName()} instead.
*
* @return array<int, string>
*/
public function getTableNames(): array
{
Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/4800',
'Schema::getTableNames() is deprecated.'
. ' Use Schema::getTables() and Table::getName() instead.',
__METHOD__
);

return array_keys($this->_tables);
}

public function hasSequence(string $name): bool
{
$name = $this->getFullQualifiedAssetName($name);
Expand Down