From 16d09790325c8011f563cf8872d9f58d1458969c Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Sun, 30 Nov 2025 22:47:32 -0600 Subject: [PATCH] Fixes abstract factory, maybe Signed-off-by: Joey Smith Signed-off-by: Joey Smith --- src/Container/AdapterAbstractServiceFactory.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Container/AdapterAbstractServiceFactory.php b/src/Container/AdapterAbstractServiceFactory.php index 7eb781b3..52e6ceb5 100644 --- a/src/Container/AdapterAbstractServiceFactory.php +++ b/src/Container/AdapterAbstractServiceFactory.php @@ -4,6 +4,7 @@ namespace PhpDb\Container; +use Laminas\ServiceManager\Factory\AbstractFactoryInterface; use PhpDb\Adapter\Adapter; use PhpDb\Adapter\AdapterInterface; use PhpDb\ResultSet\ResultSetInterface; @@ -16,7 +17,7 @@ * * Allows configuring several database instances (such as writer and reader). */ -class AdapterAbstractServiceFactory +class AdapterAbstractServiceFactory implements AbstractFactoryInterface { /** @var array */ protected $config; @@ -24,7 +25,7 @@ class AdapterAbstractServiceFactory /** * Can we create an adapter by the requested name? */ - public function canCreate(ContainerInterface $container, string $requestedName): bool + public function canCreate(ContainerInterface $container, $requestedName): bool { $config = $this->getConfig($container); if (empty($config)) { @@ -41,7 +42,7 @@ public function canCreate(ContainerInterface $container, string $requestedName): */ public function __invoke( ContainerInterface $container, - string $requestedName, + $requestedName, ?array $options = null ): AdapterInterface { $driverFactory = ($container->get(DriverInterfaceFactoryFactoryInterface::class))($container, $requestedName); @@ -57,10 +58,8 @@ public function __invoke( /** * Get db configuration, if any - * - * @return array */ - protected function getConfig(ContainerInterface $container) + protected function getConfig(ContainerInterface $container): array { if ($this->config !== null) { return $this->config;