File tree Expand file tree Collapse file tree 4 files changed +10
-33
lines changed
Expand file tree Collapse file tree 4 files changed +10
-33
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function __invoke(
3030 ): ConnectionInterface &Connection {
3131 if (! is_array ($ options ['connection ' ]) || $ options ['connection ' ] === []) {
3232 throw new InvalidConnectionParametersException (
33- 'Connection configuration must be an array of parameters pased via $options["connection"] ' ,
33+ 'Connection configuration must be an array of parameters passed via $options["connection"] ' ,
3434 $ options ['connection ' ]
3535 );
3636 }
Original file line number Diff line number Diff line change 77use Laminas \ServiceManager \ServiceManager ;
88use PhpDb \Adapter \Driver \DriverInterface ;
99use PhpDb \Adapter \Pgsql ;
10+ use PhpDb \Exception \ContainerException ;
1011use Psr \Container \ContainerInterface ;
1112
1213final class DriverInterfaceFactory
@@ -17,12 +18,13 @@ public function __invoke(
1718 ?array $ options = null
1819 ): DriverInterface {
1920 if (! $ options ['connection ' ]) {
20- throw Pgsql \ Exception \ ContainerException::forServiceFailure (
21+ throw ContainerException::forService (
2122 Pgsql \Driver::class,
22- self ::class . ' can only be used via the ServiceManager \' s build() method
23- with connection parameters passed via $options["connection"] '
23+ self ::class,
24+ ' $options["connection"] must contain an array of connection configuration. '
2425 );
2526 }
27+
2628 $ connection = $ container ->build (Pgsql \Connection::class, $ options );
2729 return new Pgsql \Driver (
2830 connection:$ connection ,
Original file line number Diff line number Diff line change 66
77use PhpDb \Adapter \Pgsql ;
88use PhpDb \Adapter \Platform \PlatformInterface ;
9+ use PhpDb \Exception \ContainerException ;
910use Psr \Container \ContainerInterface ;
1011
1112final class PlatformInterfaceFactory
1213{
1314 /**
14- * @throws Pgsql\Exception\ ContainerException
15+ * @throws ContainerException
1516 */
1617 public function __invoke (
1718 ContainerInterface $ container ,
@@ -24,8 +25,9 @@ public function __invoke(
2425 && ! $ driver instanceof Pgsql \Pdo \Driver
2526 ) {
2627 // todo: Once latest PR is merged for 0.5.0 update to use PhpDB\Exception\ContainerException
27- throw Pgsql \ Exception \ ContainerException::forServiceFailure (
28+ throw ContainerException::forService (
2829 PlatformInterface::class,
30+ self ::class,
2931 'Invalid or missing driver provided '
3032 );
3133 }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments