Remove deprecated Connection methods

parent 138eb852
# Upgrade to 3.0 # Upgrade to 3.0
## BC BREAK: Changes in the `Doctrine\DBAL\Connection` API
- The following methods have been removed as leaking internal implementation details: `::getHost()`, `::getPort()`, `::getUsername()`, `::getPassword()`.
## BC BREAK: Changes in the `Doctrine\DBAL\Event` API ## BC BREAK: Changes in the `Doctrine\DBAL\Event` API
- `ConnectionEventArgs::getDriver()`, `::getDatabasePlatform()` and `::getSchemaManager()` methods have been removed. The connection information can be obtained from the connection which is available via `::getConnection()`. - `ConnectionEventArgs::getDriver()`, `::getDatabasePlatform()` and `::getSchemaManager()` methods have been removed. The connection information can be obtained from the connection which is available via `::getConnection()`.
......
...@@ -216,54 +216,6 @@ class Connection implements DriverConnection ...@@ -216,54 +216,6 @@ class Connection implements DriverConnection
return $database; return $database;
} }
/**
* Gets the hostname of the currently connected database.
*
* @deprecated
*
* @return string|null
*/
public function getHost()
{
return $this->params['host'] ?? null;
}
/**
* Gets the port of the currently connected database.
*
* @deprecated
*
* @return mixed
*/
public function getPort()
{
return $this->params['port'] ?? null;
}
/**
* Gets the username used by this connection.
*
* @deprecated
*
* @return string|null
*/
public function getUsername()
{
return $this->params['user'] ?? null;
}
/**
* Gets the password used by this connection.
*
* @deprecated
*
* @return string|null
*/
public function getPassword()
{
return $this->params['password'] ?? null;
}
/** /**
* Gets the DBAL driver instance. * Gets the DBAL driver instance.
* *
......
...@@ -28,8 +28,7 @@ class DB2SchemaManager extends AbstractSchemaManager ...@@ -28,8 +28,7 @@ class DB2SchemaManager extends AbstractSchemaManager
*/ */
public function listTableNames() public function listTableNames()
{ {
$sql = $this->_platform->getListTablesSQL(); $sql = $this->_platform->getListTablesSQL() . ' AND CREATOR = CURRENT_USER';
$sql .= ' AND CREATOR = UPPER(' . $this->_conn->quote($this->_conn->getUsername()) . ')';
$tables = $this->_conn->fetchAllAssociative($sql); $tables = $this->_conn->fetchAllAssociative($sql);
......
...@@ -108,26 +108,6 @@ class ConnectionTest extends TestCase ...@@ -108,26 +108,6 @@ class ConnectionTest extends TestCase
self::assertInstanceOf(Configuration::class, $config); self::assertInstanceOf(Configuration::class, $config);
} }
public function testGetHost(): void
{
self::assertEquals('localhost', $this->connection->getHost());
}
public function testGetPort(): void
{
self::assertEquals('1234', $this->connection->getPort());
}
public function testGetUsername(): void
{
self::assertEquals('root', $this->connection->getUsername());
}
public function testGetPassword(): void
{
self::assertEquals('password', $this->connection->getPassword());
}
public function testGetDriver(): void public function testGetDriver(): void
{ {
self::assertInstanceOf(\Doctrine\DBAL\Driver\PDOMySql\Driver::class, $this->connection->getDriver()); self::assertInstanceOf(\Doctrine\DBAL\Driver\PDOMySql\Driver::class, $this->connection->getDriver());
......
...@@ -236,7 +236,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase ...@@ -236,7 +236,7 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$otherTable->addColumn('id', Types::STRING); $otherTable->addColumn('id', Types::STRING);
TestUtil::getPrivilegedConnection()->getSchemaManager()->dropAndCreateTable($otherTable); TestUtil::getPrivilegedConnection()->getSchemaManager()->dropAndCreateTable($otherTable);
$columns = $this->schemaManager->listTableColumns($table->getName(), $this->connection->getUsername()); $columns = $this->schemaManager->listTableColumns($table->getName(), $this->connection->getDatabase());
self::assertCount(7, $columns); self::assertCount(7, $columns);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment