1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Yiisoft\Yii\Debug\Collector\Database; |
6
|
|
|
|
7
|
|
|
use Closure; |
8
|
|
|
use Yiisoft\Cache\Dependency\Dependency; |
9
|
|
|
use Yiisoft\Db\Command\CommandInterface; |
|
|
|
|
10
|
|
|
use Yiisoft\Db\Connection\ConnectionInterface; |
|
|
|
|
11
|
|
|
use Yiisoft\Db\Query\BatchQueryResultInterface; |
|
|
|
|
12
|
|
|
use Yiisoft\Db\Query\QueryInterface; |
|
|
|
|
13
|
|
|
use Yiisoft\Db\QueryBuilder\QueryBuilderInterface; |
|
|
|
|
14
|
|
|
use Yiisoft\Db\Schema\QuoterInterface; |
|
|
|
|
15
|
|
|
use Yiisoft\Db\Schema\SchemaInterface; |
|
|
|
|
16
|
|
|
use Yiisoft\Db\Schema\TableSchemaInterface; |
|
|
|
|
17
|
|
|
use Yiisoft\Db\Transaction\TransactionInterface; |
|
|
|
|
18
|
|
|
|
19
|
|
|
final class ConnectionInterfaceProxy implements ConnectionInterface |
20
|
|
|
{ |
21
|
|
|
public function __construct( |
22
|
|
|
private ConnectionInterface $connection, |
23
|
|
|
private DatabaseCollector $collector |
24
|
|
|
) { |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public function beginTransaction(string $isolationLevel = null): TransactionInterface |
28
|
|
|
{ |
29
|
|
|
return $this->connection->beginTransaction($isolationLevel); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public function cache(Closure $closure, int $duration = null, Dependency $dependency = null): mixed |
33
|
|
|
{ |
34
|
|
|
return $this->connection->cache($closure, $duration, $dependency); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
public function createBatchQueryResult(QueryInterface $query, bool $each = false): BatchQueryResultInterface |
38
|
|
|
{ |
39
|
|
|
return $this->connection->createBatchQueryResult($query, $each); |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public function createCommand(string $sql = null, array $params = []): CommandInterface |
43
|
|
|
{ |
44
|
|
|
[$callStack] = debug_backtrace(); |
45
|
|
|
|
46
|
|
|
$this->collector->collect($sql, $params, $callStack['file'] . ':' . $callStack['line']); |
|
|
|
|
47
|
|
|
|
48
|
|
|
return $this->connection->createCommand($sql, $params); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
public function createTransaction(): TransactionInterface |
52
|
|
|
{ |
53
|
|
|
return $this->connection->createTransaction(); |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public function close(): void |
57
|
|
|
{ |
58
|
|
|
$this->connection->close(); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
public function getCacheKey(): array |
62
|
|
|
{ |
63
|
|
|
return $this->connection->getCacheKey(); |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
public function getName(): string |
67
|
|
|
{ |
68
|
|
|
return $this->connection->getName(); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function getLastInsertID(string $sequenceName = null): string |
72
|
|
|
{ |
73
|
|
|
return $this->connection->getLastInsertID($sequenceName); |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
public function getQueryBuilder(): QueryBuilderInterface |
77
|
|
|
{ |
78
|
|
|
return $this->connection->getQueryBuilder(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
public function getQuoter(): QuoterInterface |
82
|
|
|
{ |
83
|
|
|
return $this->connection->getQuoter(); |
84
|
|
|
} |
85
|
|
|
|
86
|
|
|
public function getSchema(): SchemaInterface |
87
|
|
|
{ |
88
|
|
|
return $this->connection->getSchema(); |
89
|
|
|
} |
90
|
|
|
|
91
|
|
|
public function getServerVersion(): string |
92
|
|
|
{ |
93
|
|
|
return $this->connection->getServerVersion(); |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
public function getTablePrefix(): string |
97
|
|
|
{ |
98
|
|
|
return $this->connection->getTablePrefix(); |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
public function getTableSchema(string $name, bool $refresh = false): TableSchemaInterface|null |
102
|
|
|
{ |
103
|
|
|
return $this->connection->getTableSchema($name, $refresh); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
public function getTransaction(): TransactionInterface|null |
107
|
|
|
{ |
108
|
|
|
return $this->connection->getTransaction(); |
109
|
|
|
} |
110
|
|
|
|
111
|
|
|
public function isActive(): bool |
112
|
|
|
{ |
113
|
|
|
return $this->connection->isActive(); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
public function isSavepointEnabled(): bool |
117
|
|
|
{ |
118
|
|
|
return $this->connection->isSavepointEnabled(); |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
public function noCache(Closure $closure): mixed |
122
|
|
|
{ |
123
|
|
|
return $this->connection->noCache($closure); |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
public function notProfiler(): void |
127
|
|
|
{ |
128
|
|
|
$this->connection->notProfiler(); |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
public function open(): void |
132
|
|
|
{ |
133
|
|
|
$this->connection->open(); |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
public function queryCacheEnable(bool $value): void |
137
|
|
|
{ |
138
|
|
|
$this->connection->queryCacheEnable($value); |
139
|
|
|
} |
140
|
|
|
|
141
|
|
|
public function quoteValue(mixed $value): mixed |
142
|
|
|
{ |
143
|
|
|
return $this->connection->quoteValue($value); |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
public function setEnableSavepoint(bool $value): void |
147
|
|
|
{ |
148
|
|
|
$this->connection->setEnableSavepoint($value); |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
public function setTablePrefix(string $value): void |
152
|
|
|
{ |
153
|
|
|
$this->connection->setTablePrefix($value); |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
public function transaction(Closure $closure, string $isolationLevel = null): mixed |
157
|
|
|
{ |
158
|
|
|
return $this->connection->transaction($closure, $isolationLevel); |
159
|
|
|
} |
160
|
|
|
} |
161
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths