Skip to content

Commit 7bb7982

Browse files
committed
✨ SettingsContainerInterface
1 parent a4c071f commit 7bb7982

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,16 @@
2222
},
2323
"require": {
2424
"php": "^7.2",
25-
"chillerlan/php-traits": "^2.0",
25+
"chillerlan/php-settings-container": "^1.0",
2626
"psr/simple-cache": "^1.0",
2727
"psr/log": "^1.0"
2828
},
2929
"require-dev": {
30+
"chillerlan/php-dotenv": "^1.0",
31+
"chillerlan/php-traits": "^2.0",
3032
"chillerlan/php-cache": "^2.0",
3133
"chillerlan/php-log": "^2.0",
32-
"phpunit/phpunit": "^7.3"
34+
"phpunit/phpunit": "^7.4"
3335
},
3436
"autoload": {
3537
"psr-4": {

src/DatabaseAbstract.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
use chillerlan\Database\{
1616
Drivers\DriverInterface, Query\QueryBuilder
1717
};
18-
use chillerlan\Traits\{
19-
ImmutableSettingsInterface
20-
};
18+
use chillerlan\Settings\SettingsContainerInterface;
2119
use Psr\Log\{
2220
LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger
2321
};
@@ -49,13 +47,13 @@ abstract class DatabaseAbstract implements LoggerAwareInterface{
4947
/**
5048
* Database constructor.
5149
*
52-
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
50+
* @param \chillerlan\Settings\SettingsContainerInterface $options
5351
* @param \Psr\SimpleCache\CacheInterface|null $cache
5452
* @param \Psr\Log\LoggerInterface|null $logger
5553
*
5654
* @throws \chillerlan\Database\DatabaseException
5755
*/
58-
public function __construct(ImmutableSettingsInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
56+
public function __construct(SettingsContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
5957
$this->options = $options;
6058
$this->cache = $cache;
6159

src/DatabaseOptions.php

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

1313
namespace chillerlan\Database;
1414

15-
use chillerlan\Traits\ImmutableSettingsAbstract;
15+
use chillerlan\Settings\SettingsContainerAbstract;
1616

1717
/**
1818
* @property string $driver
@@ -41,6 +41,6 @@
4141
* @property string $cachekey_hash_algo
4242
* @property string $storage_path
4343
*/
44-
class DatabaseOptions extends ImmutableSettingsAbstract{
44+
class DatabaseOptions extends SettingsContainerAbstract{
4545
use DatabaseOptionsTrait;
4646
}

src/Drivers/DriverAbstract.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use chillerlan\Database\{
1616
Dialects\Dialect, Result
1717
};
18-
use chillerlan\Traits\ImmutableSettingsInterface;
18+
use chillerlan\Settings\SettingsContainerInterface;
1919
use Psr\Log\{
2020
LoggerAwareInterface, LoggerAwareTrait, LoggerInterface
2121
};
@@ -60,11 +60,11 @@ abstract class DriverAbstract implements DriverInterface, LoggerAwareInterface{
6060
/**
6161
* Constructor.
6262
*
63-
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
63+
* @param \chillerlan\Settings\SettingsContainerInterface $options
6464
* @param \Psr\SimpleCache\CacheInterface|null $cache
6565
* @param \Psr\Log\LoggerInterface|null $logger
6666
*/
67-
public function __construct(ImmutableSettingsInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
67+
public function __construct(SettingsContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
6868
$this->options = $options;
6969
$this->cache = $cache;
7070
$this->logger = $logger;

src/Drivers/DriverInterface.php

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

1515
use chillerlan\Database\Dialects\Dialect;
16-
use chillerlan\Traits\ImmutableSettingsInterface;
16+
use chillerlan\Settings\SettingsContainerInterface;
1717
use Psr\Log\LoggerInterface;
1818
use Psr\SimpleCache\CacheInterface;
1919

@@ -22,11 +22,11 @@ interface DriverInterface{
2222
/**
2323
* Constructor.
2424
*
25-
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
25+
* @param \chillerlan\Settings\SettingsContainerInterface $options
2626
* @param \Psr\SimpleCache\CacheInterface|null $cache
2727
* @param \Psr\Log\LoggerInterface|null $logger
2828
*/
29-
public function __construct(ImmutableSettingsInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null);
29+
public function __construct(SettingsContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null);
3030

3131
/**
3232
* Establishes a database connection and returns the connection object

src/Drivers/MSSqlSrvPDO.php

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

1515
use chillerlan\Database\Dialects\MSSQL;
16-
use chillerlan\Traits\ImmutableSettingsInterface;
16+
use chillerlan\Settings\SettingsContainerInterface;
1717
use PDO;
1818
use Psr\{
1919
Log\LoggerInterface, SimpleCache\CacheInterface
@@ -30,11 +30,11 @@ class MSSqlSrvPDO extends PDODriverAbstract{
3030
/**
3131
* MSSqlSrvPDO constructor.
3232
*
33-
* @param \chillerlan\Traits\ImmutableSettingsInterface $options
33+
* @param \chillerlan\Settings\SettingsContainerInterface $options
3434
* @param \Psr\SimpleCache\CacheInterface|null $cache
3535
* @param \Psr\Log\LoggerInterface|null $log
3636
*/
37-
public function __construct(ImmutableSettingsInterface $options, CacheInterface $cache = null, LoggerInterface $log = null){
37+
public function __construct(SettingsContainerInterface $options, CacheInterface $cache = null, LoggerInterface $log = null){
3838
unset($this->pdo_options[PDO::ATTR_EMULATE_PREPARES]);
3939

4040
// @todo

src/Dumper.php

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

1313
namespace chillerlan\Database;
1414

15-
use chillerlan\Traits\ImmutableSettingsInterface;
15+
use chillerlan\Settings\SettingsContainerInterface;
1616
use Psr\Log\LoggerInterface;
1717
use Psr\SimpleCache\CacheInterface;
1818

@@ -28,7 +28,7 @@ class Dumper extends DatabaseAbstract{
2828
*/
2929
protected $dialect;
3030

31-
public function __construct(ImmutableSettingsInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
31+
public function __construct(SettingsContainerInterface $options, CacheInterface $cache = null, LoggerInterface $logger = null){
3232
parent::__construct($options, $cache, $logger);
3333

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

0 commit comments

Comments
 (0)