Skip to content

Commit 2bf33e3

Browse files
committed
Signed-off-by: Joey Smith <jsmith@webinertia.net>
1 parent 6550b83 commit 2bf33e3

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/Container/AdapterFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
namespace Laminas\Db\Adapter\Mysql\Container;
66

77
use Laminas\Db\Adapter\Driver\DriverInterface;
8-
use Laminas\Db\Adapter\Driver\ResultInterface;
98
use Laminas\Db\Adapter\Mysql\Adapter;
109
use Laminas\Db\Adapter\Platform\PlatformInterface;
1110
use Laminas\Db\Adapter\Profiler\ProfilerInterface;
1211
use Laminas\Db\Container\AdapterManager;
12+
use Laminas\Db\ResultSet\ResultSetInterface;
1313
use Psr\Container\ContainerInterface;
1414

1515
final class AdapterFactory
@@ -21,7 +21,7 @@ public function __invoke(ContainerInterface $container): Adapter
2121
return new Adapter(
2222
$adapterManager->get(DriverInterface::class),
2323
$adapterManager->get(PlatformInterface::class),
24-
$adapterManager->get(ResultInterface::class),
24+
$adapterManager->get(ResultSetInterface::class),
2525
$adapterManager->get(ProfilerInterface::class)
2626
);
2727
}

src/Container/AdapterManagerDelegator.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Laminas\Db\Adapter\Platform\PlatformInterface;
1212
use Laminas\Db\Adapter\Profiler;
1313
use Laminas\Db\Container\AdapterManager;
14+
use Laminas\Db\ResultSet\ResultSetInterface;
1415
use Laminas\ServiceManager\Factory\DelegatorFactoryInterface;
1516
use Laminas\ServiceManager\Factory\InvokableFactory;
1617
use Psr\Container\ContainerInterface;
@@ -35,6 +36,7 @@ public function __invoke(
3536
PlatformInterface::class => PlatformInterfaceFactory::class,
3637
Profiler\Profiler::class => InvokableFactory::class,
3738
ResultInterface::class => ResultInterfaceFactory::class,
39+
ResultSetInterface::class => InvokableFactory::class,
3840
],
3941
]);
4042

src/Container/InterfaceFactoryTrait.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,19 @@ private function getConnection(AdapterManager $adapterManager): ConnectionInterf
2626
return new Driver\Mysqli\Connection($config);
2727
}
2828

29+
// todo: pull the ResultInterface from the adapter manager and pass it to the driver
2930
private function getDriver(AdapterManager $adapterManager): DriverInterface
3031
{
3132
$config = $adapterManager->get('db');
3233

3334
if ($this->isPdo($config['driver'])) {
34-
return new Driver\Pdo\Pdo($adapterManager->get(ConnectionInterface::class));
35+
return new Driver\Pdo\Pdo(
36+
$adapterManager->get(ConnectionInterface::class)
37+
);
3538
}
36-
return new Driver\Mysqli\Mysqli($adapterManager->get(ConnectionInterface::class));
39+
return new Driver\Mysqli\Mysqli(
40+
$adapterManager->get(ConnectionInterface::class)
41+
);
3742
}
3843

3944
private function getResult(AdapterManager $adapterManager): ResultInterface

0 commit comments

Comments
 (0)