Unverified Commit b5a71d17 authored by Marius Ghita's avatar Marius Ghita Committed by GitHub

Remove superfluous Configuration instance

A configuration instance is not strictly required by [DriverManager::getConnection](https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/DriverManager.php#L139).

As an upside, it doesn't add an extra warning for people that use Psalm/PHPmd when starting off from the documentation example. As the Configuration class has an `@internal` block those tools threat it as the other meaning for `@internal`, as in class that is [internal to the library and not for public use](https://docs.phpdoc.org/references/phpdoc/tags/internal.html).
parent 400f6044
...@@ -10,7 +10,6 @@ You can get a DBAL Connection through the ...@@ -10,7 +10,6 @@ You can get a DBAL Connection through the
.. code-block:: php .. code-block:: php
<?php <?php
$config = new \Doctrine\DBAL\Configuration();
//.. //..
$connectionParams = array( $connectionParams = array(
'dbname' => 'mydb', 'dbname' => 'mydb',
...@@ -19,19 +18,18 @@ You can get a DBAL Connection through the ...@@ -19,19 +18,18 @@ You can get a DBAL Connection through the
'host' => 'localhost', 'host' => 'localhost',
'driver' => 'pdo_mysql', 'driver' => 'pdo_mysql',
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
Or, using the simpler URL form: Or, using the simpler URL form:
.. code-block:: php .. code-block:: php
<?php <?php
$config = new \Doctrine\DBAL\Configuration();
//.. //..
$connectionParams = array( $connectionParams = array(
'url' => 'mysql://user:secret@localhost/mydb', 'url' => 'mysql://user:secret@localhost/mydb',
); );
$conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams);
The ``DriverManager`` returns an instance of The ``DriverManager`` returns an instance of
``Doctrine\DBAL\Connection`` which is a wrapper around the ``Doctrine\DBAL\Connection`` which is a wrapper around the
......
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