Skip to content

Commit 220de07

Browse files
committed
:octocat: DatabaseOptions -> ContainerInterface
1 parent cf26d61 commit 220de07

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

src/DatabaseAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
Drivers\DriverInterface, Query\QueryBuilder
1717
};
1818
use chillerlan\{
19-
Logger\LogTrait, Traits\ClassLoader
19+
Logger\LogTrait, Traits\ClassLoader, Traits\ContainerInterface
2020
};
2121
use Psr\{
2222
Log\LoggerAwareInterface, Log\LoggerInterface, SimpleCache\CacheInterface
@@ -48,11 +48,11 @@ abstract class DatabaseAbstract implements LoggerAwareInterface{
4848
/**
4949
* Database constructor.
5050
*
51-
* @param \chillerlan\Database\DatabaseOptions $options
51+
* @param \chillerlan\Traits\ContainerInterface $options
5252
* @param \Psr\SimpleCache\CacheInterface|null $cache
5353
* @param \Psr\Log\LoggerInterface|null $logger
5454
*/
55-
public function __construct(DatabaseOptions $options, CacheInterface $cache = null, LoggerInterface $logger = null){
55+
public function __construct(ContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
5656
$this->options = $options;
5757
$this->cache = $cache;
5858
$this->driver = $this->loadClass($this->options->driver, DriverInterface::class, $this->options, $this->cache, $this->log);

src/Drivers/DriverAbstract.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
namespace chillerlan\Database\Drivers;
1414

1515
use chillerlan\Database\{
16-
DatabaseOptions, Dialects\Dialect, Result
16+
Dialects\Dialect, Result
1717
};
1818
use chillerlan\Logger\LogTrait;
19+
use chillerlan\Traits\ContainerInterface;
1920
use Psr\{
2021
Log\LoggerAwareInterface, Log\LoggerInterface, SimpleCache\CacheInterface
2122
};
@@ -59,11 +60,11 @@ abstract class DriverAbstract implements DriverInterface, LoggerAwareInterface{
5960
/**
6061
* Constructor.
6162
*
62-
* @param \chillerlan\Database\DatabaseOptions $options
63+
* @param \chillerlan\Traits\ContainerInterface $options
6364
* @param \Psr\SimpleCache\CacheInterface|null $cache
6465
* @param \Psr\Log\LoggerInterface|null $logger
6566
*/
66-
public function __construct(DatabaseOptions $options, CacheInterface $cache = null, LoggerInterface $logger = null){
67+
public function __construct(ContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
6768
$this->options = $options;
6869
$this->cache = $cache;
6970
$this->log = $logger;

src/Drivers/DriverInterface.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use chillerlan\Database\{
1616
DatabaseOptions, Dialects\Dialect
1717
};
18+
use chillerlan\Traits\ContainerInterface;
1819
use Psr\{
1920
Log\LoggerInterface, SimpleCache\CacheInterface
2021
};
@@ -24,11 +25,11 @@ interface DriverInterface{
2425
/**
2526
* Constructor.
2627
*
27-
* @param \chillerlan\Database\DatabaseOptions $options
28-
* @param \Psr\SimpleCache\CacheInterface|null $cache
29-
* @param \Psr\Log\LoggerInterface|null $logger
28+
* @param \chillerlan\Traits\ContainerInterface $options
29+
* @param \Psr\SimpleCache\CacheInterface|null $cache
30+
* @param \Psr\Log\LoggerInterface|null $logger
3031
*/
31-
public function __construct(DatabaseOptions $options, CacheInterface $cache = null, LoggerInterface $logger = null);
32+
public function __construct(ContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null);
3233

3334
/**
3435
* Establishes a database connection and returns the connection object

src/Dumper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
namespace chillerlan\Database;
1414

15+
use chillerlan\Traits\ContainerInterface;
1516
use Psr\Log\LoggerInterface;
1617
use Psr\SimpleCache\CacheInterface;
1718

@@ -27,7 +28,7 @@ class Dumper extends DatabaseAbstract{
2728
*/
2829
protected $dialect;
2930

30-
public function __construct(DatabaseOptions $options, CacheInterface $cache = null, LoggerInterface $logger = null){
31+
public function __construct(ContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
3132
parent::__construct($options, $cache, $logger);
3233

3334
$this->dialect = $this->driver->getDialect();

0 commit comments

Comments
 (0)