Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Adapter/Driver/Pdo/AbstractPdo.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ abstract class AbstractPdo implements PdoDriverInterface, ProfilerAwareInterface
protected ?ProfilerInterface $profiler;

public function __construct(
protected readonly AbstractPdoConnection|PDO $connection,
protected readonly StatementInterface&PdoDriverAwareInterface $statementPrototype,
protected readonly ResultInterface $resultPrototype,
protected AbstractPdoConnection|PDO $connection,
protected StatementInterface&PdoDriverAwareInterface $statementPrototype,
protected ResultInterface $resultPrototype,
array $features = [],
) {
if ($this->connection instanceof PdoDriverAwareInterface) {
Expand Down
9 changes: 3 additions & 6 deletions src/Container/AdapterAbstractServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AdapterAbstractServiceFactory implements AbstractFactoryInterface
/**
* 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)) {
Expand All @@ -42,14 +42,13 @@ 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);
$driverInstance = $driverFactory::createFromConfig($container, $requestedName);
$platformFactory = ($container->get(PlatformInterfaceFactoryFactoryInterface::class))();

//$config = $this->getConfig($container);
return new Adapter(
$driverInstance,
$platformFactory::fromDriver($driverInstance),
Expand All @@ -59,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;
Expand Down
Loading