Skip to content

Commit 7d618eb

Browse files
Refactor code. (#240)
* Move SchemaCache::class to Schema::class. * Remove LazyConnectionDependencies::class, add setLogger(), setProfiler(). * Implement LoggerInterface::class and ProfilerInterface::class as optional. * Add QueryCache::class in construct() Command::class. * Interface 'QueryInterface' Missing 'select' method declaration (#221). * Remove unnecessary DatabaseFactory.php. * Remove unnecessary getters. * better naming setMasters() and setSlaves(). * Remove duplicate code all packages. * Remove yiisoft/di. Co-authored-by: Wilmer Arambula <terabytesoftw@users.noreply.github.com>
1 parent b373efc commit 7d618eb

12 files changed

Lines changed: 513 additions & 470 deletions

File tree

composer.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
"yiisoft/arrays": "^1.0",
2727
"yiisoft/cache": "^1.0",
2828
"yiisoft/data": "^3.0@dev",
29-
"yiisoft/factory": "^3.0@dev",
3029
"yiisoft/log": "^1.0",
3130
"yiisoft/profiler": "^1.0",
3231
"yiisoft/strings": "^2.0"
@@ -37,7 +36,6 @@
3736
"spatie/phpunit-watcher": "^1.23",
3837
"vimeo/psalm": "^4.2",
3938
"yiisoft/aliases": "^1.1|^2.0",
40-
"yiisoft/di": "^3.0@dev",
4139
"yiisoft/event-dispatcher": "^1.0",
4240
"yiisoft/json": "^1.0"
4341
},
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Yiisoft\Db\AwareTrait;
6+
7+
use Psr\Log\LoggerInterface;
8+
9+
trait LoggerAwareTrait
10+
{
11+
protected ?LoggerInterface $logger = null;
12+
13+
public function setLogger(?LoggerInterface $logger): void
14+
{
15+
$this->logger = $logger;
16+
}
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Yiisoft\Db\AwareTrait;
6+
7+
use Yiisoft\Profiler\ProfilerInterface;
8+
9+
trait ProfilerAwareTrait
10+
{
11+
protected ?ProfilerInterface $profiler = null;
12+
13+
public function setProfiler(?ProfilerInterface $profiler): void
14+
{
15+
$this->profiler = $profiler;
16+
}
17+
}

0 commit comments

Comments
 (0)