Mark connection constructors internal

parent 1527d709
...@@ -19,9 +19,11 @@ The method is not used anywhere except for tests. ...@@ -19,9 +19,11 @@ 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. 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.
## The `PingableConnection` interface is deprecated ## The `PingableConnection` interface is deprecated
......
...@@ -168,6 +168,8 @@ class Connection implements DriverConnection ...@@ -168,6 +168,8 @@ class Connection implements DriverConnection
/** /**
* Initializes a new instance of the Connection class. * 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 mixed[] $params The connection parameters.
* @param Driver $driver The driver to use. * @param Driver $driver The driver to use.
* @param Configuration|null $config The configuration, optional. * @param Configuration|null $config The configuration, optional.
......
...@@ -20,6 +20,8 @@ class MasterSlaveConnection extends PrimaryReadReplicaConnection ...@@ -20,6 +20,8 @@ class MasterSlaveConnection extends PrimaryReadReplicaConnection
/** /**
* Creates Primary Replica Connection. * Creates Primary Replica Connection.
* *
* @internal The connection can be only instantiated by the driver manager.
*
* @param mixed[] $params * @param mixed[] $params
* *
* @throws InvalidArgumentException * @throws InvalidArgumentException
......
...@@ -90,6 +90,8 @@ class PrimaryReadReplicaConnection extends Connection ...@@ -90,6 +90,8 @@ class PrimaryReadReplicaConnection extends Connection
/** /**
* Creates Primary Replica Connection. * Creates Primary Replica Connection.
* *
* @internal The connection can be only instantiated by the driver manager.
*
* @param mixed[] $params * @param mixed[] $params
* *
* @throws InvalidArgumentException * @throws InvalidArgumentException
......
...@@ -40,6 +40,8 @@ class DB2Connection implements ConnectionInterface, ServerInfoAwareConnection ...@@ -40,6 +40,8 @@ class DB2Connection implements ConnectionInterface, ServerInfoAwareConnection
private $conn = null; private $conn = null;
/** /**
* @internal The connection can be only instantiated by its driver.
*
* @param mixed[] $params * @param mixed[] $params
* @param string $username * @param string $username
* @param string $password * @param string $password
......
...@@ -46,6 +46,8 @@ class MysqliConnection implements ConnectionInterface, PingableConnection, Serve ...@@ -46,6 +46,8 @@ class MysqliConnection implements ConnectionInterface, PingableConnection, Serve
private $conn; private $conn;
/** /**
* @internal The connection can be only instantiated by its driver.
*
* @param mixed[] $params * @param mixed[] $params
* @param string $username * @param string $username
* @param string $password * @param string $password
......
...@@ -41,6 +41,8 @@ class OCI8Connection implements ConnectionInterface, ServerInfoAwareConnection ...@@ -41,6 +41,8 @@ class OCI8Connection implements ConnectionInterface, ServerInfoAwareConnection
/** /**
* Creates a Connection to an Oracle Database using oci8 extension. * 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 $username
* @param string $password * @param string $password
* @param string $db * @param string $db
......
...@@ -22,6 +22,8 @@ use function func_get_args; ...@@ -22,6 +22,8 @@ use function func_get_args;
class PDOConnection extends PDO implements ConnectionInterface, ServerInfoAwareConnection class PDOConnection extends PDO implements ConnectionInterface, ServerInfoAwareConnection
{ {
/** /**
* @internal The connection can be only instantiated by its driver.
*
* @param string $dsn * @param string $dsn
* @param string|null $user * @param string|null $user
* @param string|null $password * @param string|null $password
......
...@@ -17,6 +17,8 @@ use function substr; ...@@ -17,6 +17,8 @@ use function substr;
class Connection extends BaseConnection class Connection extends BaseConnection
{ {
/** /**
* @internal The connection can be only instantiated by its driver.
*
* {@inheritdoc} * {@inheritdoc}
*/ */
public function __construct($dsn, $user = null, $password = null, ?array $options = null) public function __construct($dsn, $user = null, $password = null, ?array $options = null)
......
...@@ -36,6 +36,8 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection ...@@ -36,6 +36,8 @@ class SQLAnywhereConnection implements Connection, ServerInfoAwareConnection
/** /**
* Connects to database with given connection string. * Connects to database with given connection string.
* *
* @internal The connection can be only instantiated by its driver.
*
* @param string $dsn The connection string. * @param string $dsn The connection string.
* @param bool $persistent Whether or not to establish a persistent connection. * @param bool $persistent Whether or not to establish a persistent connection.
* *
......
...@@ -39,6 +39,8 @@ class SQLSrvConnection implements ConnectionInterface, ServerInfoAwareConnection ...@@ -39,6 +39,8 @@ class SQLSrvConnection implements ConnectionInterface, ServerInfoAwareConnection
protected $lastInsertId; protected $lastInsertId;
/** /**
* @internal The connection can be only instantiated by its driver.
*
* @param string $serverName * @param string $serverName
* @param mixed[] $connectionOptions * @param mixed[] $connectionOptions
* *
......
...@@ -65,6 +65,8 @@ class PoolingShardConnection extends Connection ...@@ -65,6 +65,8 @@ class PoolingShardConnection extends Connection
/** /**
* {@inheritDoc} * {@inheritDoc}
* *
* @internal The connection can be only instantiated by the driver manager.
*
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
public function __construct(array $params, Driver $driver, ?Configuration $config = null, ?EventManager $eventManager = null) 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