spotorm / spot2

Spot v2.x DataMapper built on top of Doctrine's Database Abstraction Layer
http://phpdatamapper.com
BSD 3-Clause "New" or "Revised" License
601 stars 101 forks source link

Allow dsn in addConnection to be of type Array or DBAL\Connection #234

Closed danopz closed 7 years ago

danopz commented 7 years ago

Documentation on Link has an example to add a connection via an array. The method doc for addConnection says that the second param must be of type string, but this is not true. Some could either pass an Array, a String, or an instance of DBAL\Connection so I updated the param type to reflect this. I found this problem because PHPStorm gave me a notice abut this. Also fixed a typo for the default param.

vlucas commented 7 years ago

This needs a test to accompany it that demonstrates this works.

FlipEverything commented 7 years ago

Agreed.

danopz commented 7 years ago

There are already tests for array and Connection: https://github.com/spotorm/spot2/blob/master/tests/Config.php#L49-L79

vlucas commented 7 years ago

My bad. I didn't realize that this was just updating the comment.