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;