Skip to content

Commit a9fe04e

Browse files
committed
Removes a custom exception class that has been moved to php-db/phpdb and refactors DriverInterfaceFactory to use the new class.
Signed-off-by: Joey Smith <jsmith@webinertia.net> Signed-off-by: Joey Smith <jsmith@webinertia.net>
1 parent 28df694 commit a9fe04e

2 files changed

Lines changed: 4 additions & 30 deletions

File tree

src/Container/DriverInterfaceFactory.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Laminas\ServiceManager\ServiceManager;
88
use PhpDb\Adapter\Driver\DriverInterface;
99
use PhpDb\Adapter\Pgsql;
10+
use PhpDb\Exception\ContainerException;
1011
use Psr\Container\ContainerInterface;
1112

1213
final class DriverInterfaceFactory
@@ -17,10 +18,10 @@ 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 parameters.'
2425
);
2526
}
2627
$connection = $container->build(Pgsql\Connection::class, $options);

src/Exception/ContainerException.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)