Unverified Commit 0a4630aa authored by Sergei Morozov's avatar Sergei Morozov Committed by GitHub

Merge pull request #4139 from morozov/driver-iternals

Mark connection constructors internal
parents 1527d709 f5714c57
......@@ -19,9 +19,13 @@ The method is not used anywhere except for tests.
The `ServerInfoAwareConnection::requiresQueryForServerVersion()` method has been deprecated as an implementation detail which is the same for almost all supported drivers.
## Statement constructors are marked internal
## Connection and Statement constructors are marked internal
The driver and wrapper statement objects can be only created by the corresponding connection objects.
1. Driver connection objects can be only created by the corresponding drivers.
2. Wrapper connection objects can be only created by the driver manager.
3. The driver and wrapper connection objects can be only created by the corresponding connection objects.
Additionally, the `SQLSrv\LastInsertId` class has been marked internal.
## The `PingableConnection` interface is deprecated
......
......@@ -168,6 +168,8 @@ class Connection implements DriverConnection
/**
* Initializes a new instance of the Connection class.
*
* @internal The connection can be only instantiated by the driver manager.
*
* @param mixed[] $params The connection parameters.
* @param Driver $driver The driver to use.
* @param Configuration|null $config The configuration, optional.
......
......@@ -20,6 +20,8 @@ class MasterSlaveConnection extends PrimaryReadReplicaConnection
/**
* Creates Primary Replica Connection.
*
* @internal The connection can be only instantiated by the driver manager.
*
* @param mixed[] $params
*
* @throws InvalidArgumentException
......
......@@ -90,6 +90,8 @@ class PrimaryReadReplicaConnection extends Connection
/**
* Creates Primary Replica Connection.
*
* @internal The connection can be only instantiated by the driver manager.
*
* @param mixed[] $params
*
* @throws InvalidArgumentException
......
......@@ -40,6 +40,8 @@ class DB2Connection implements ConnectionInterface, ServerInfoAwareConnection
private $conn = null;
/**
* @internal The connection can be only instantiated by its driver.
*
* @param mixed[] $params
* @param string $username
* @param string $password
......
......@@ -46,6 +46,8 @@ class MysqliConnection implements ConnectionInterface, PingableConnection, Serve
private $conn;
/**
* @internal The connection can be only instantiated by its driver.
*
* @param mixed[] $params
* @param string $username
* @param string $password
......
......@@ -41,6 +41,8 @@ class OCI8Connection implements ConnectionInterface, ServerInfoAwareConnection
/**
* Creates a Connection to an Oracle Database using oci8 extension.
*
* @internal The connection can be only instantiated by its driver.
*
* @param string $username
* @param string $password
* @param string $db
......
......@@ -22,6 +22,8 @@ use function func_get_args;
class PDOConnection extends PDO implements ConnectionInterface, ServerInfoAwareConnection
{
/**
* @internal The connection can be only instantiated by its driver.
*
* @param string $dsn
* @param string|null $user
* @param string|null $password
......
......@@ -17,6 +17,8 @@ use function substr;
class Connection extends BaseConnection
{
/**
* @internal The connection can be only instantiated by its driver.
*
* {@inheritdoc}
*/
public function __construct($dsn, $user = null, $password = null, ?array $options = null)
......
......@@ -36,6 +36,8 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection
/**
* Connects to database with given connection string.
*
* @internal The connection can be only instantiated by its driver.
*
* @param string $dsn The connection string.
* @param bool $persistent Whether or not to establish a persistent connection.
*
......
......@@ -4,6 +4,8 @@ namespace Doctrine\DBAL\Driver\SQLSrv;
/**
* Last Id Data Container.
*
* @internal
*/
class LastInsertId
{
......
......@@ -39,6 +39,8 @@ class SQLSrvConnection implements ConnectionInterface, ServerInfoAwareConnection
protected $lastInsertId;
/**
* @internal The connection can be only instantiated by its driver.
*
* @param string $serverName
* @param mixed[] $connectionOptions
*
......
......@@ -65,6 +65,8 @@ class PoolingShardConnection extends Connection
/**
* {@inheritDoc}
*
* @internal The connection can be only instantiated by the driver manager.
*
* @throws InvalidArgumentException
*/
public function __construct(array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null)
......
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