Skip to content

Commit b3df2ff

Browse files
authored
Merge pull request #95 from tyrsson/0.3.2-patch
Fixes abstract factory, maybe
2 parents 7acc1d0 + 16d0979 commit b3df2ff

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/Container/AdapterAbstractServiceFactory.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace PhpDb\Container;
66

7+
use Laminas\ServiceManager\Factory\AbstractFactoryInterface;
78
use PhpDb\Adapter\Adapter;
89
use PhpDb\Adapter\AdapterInterface;
910
use PhpDb\ResultSet\ResultSetInterface;
@@ -16,15 +17,15 @@
1617
*
1718
* Allows configuring several database instances (such as writer and reader).
1819
*/
19-
class AdapterAbstractServiceFactory
20+
class AdapterAbstractServiceFactory implements AbstractFactoryInterface
2021
{
2122
/** @var array */
2223
protected $config;
2324

2425
/**
2526
* Can we create an adapter by the requested name?
2627
*/
27-
public function canCreate(ContainerInterface $container, string $requestedName): bool
28+
public function canCreate(ContainerInterface $container, $requestedName): bool
2829
{
2930
$config = $this->getConfig($container);
3031
if (empty($config)) {
@@ -41,7 +42,7 @@ public function canCreate(ContainerInterface $container, string $requestedName):
4142
*/
4243
public function __invoke(
4344
ContainerInterface $container,
44-
string $requestedName,
45+
$requestedName,
4546
?array $options = null
4647
): AdapterInterface {
4748
$driverFactory = ($container->get(DriverInterfaceFactoryFactoryInterface::class))($container, $requestedName);
@@ -57,10 +58,8 @@ public function __invoke(
5758

5859
/**
5960
* Get db configuration, if any
60-
*
61-
* @return array
6261
*/
63-
protected function getConfig(ContainerInterface $container)
62+
protected function getConfig(ContainerInterface $container): array
6463
{
6564
if ($this->config !== null) {
6665
return $this->config;

0 commit comments

Comments
 (0)