Skip to content

Commit 9ba35d1

Browse files
committed
some internal callbacks changed to private
1 parent a215a87 commit 9ba35d1

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

src/Bridges/DatabaseTracy/ConnectionPanel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ class ConnectionPanel implements Tracy\IBarPanel
4646

4747
public function __construct(Connection $connection)
4848
{
49-
$connection->onQuery[] = [$this, 'logQuery'];
49+
$connection->onQuery[] = \Closure::fromCallable([$this, 'logQuery']);
5050
}
5151

5252

53-
public function logQuery(Connection $connection, $result): void
53+
private function logQuery(Connection $connection, $result): void
5454
{
5555
if ($this->disabled) {
5656
return;

src/Database/SqlPreprocessor.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public function process(array $params, bool $useParams = false): array
9797
$res[] = Nette\Utils\Strings::replace(
9898
$param,
9999
'~\'[^\']*+\'|"[^"]*+"|\?[a-z]*|^\s*+(?:\(?\s*SELECT|INSERT|UPDATE|DELETE|REPLACE|EXPLAIN)\b|\b(?:SET|WHERE|HAVING|ORDER BY|GROUP BY|KEY UPDATE)(?=\s*$|\s*\?)|/\*.*?\*/|--[^\n]*~Dsi',
100-
[$this, 'callback']
100+
\Closure::fromCallable([$this, 'callback'])
101101
);
102102
} else {
103103
throw new Nette\InvalidArgumentException('There are more parameters than placeholders.');
@@ -108,8 +108,7 @@ public function process(array $params, bool $useParams = false): array
108108
}
109109

110110

111-
/** @internal */
112-
public function callback(array $m): string
111+
private function callback(array $m): string
113112
{
114113
$m = $m[0];
115114
if ($m[0] === '?') { // placeholder

src/Database/Structure.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,11 @@ protected function needStructure(): void
177177
return;
178178
}
179179

180-
$this->structure = $this->cache->load('structure', [$this, 'loadStructure']);
180+
$this->structure = $this->cache->load('structure', \Closure::fromCallable([$this, 'loadStructure']));
181181
}
182182

183183

184-
/**
185-
* @internal
186-
*/
187-
public function loadStructure(): array
184+
protected function loadStructure(): array
188185
{
189186
$driver = $this->connection->getSupplementalDriver();
190187

0 commit comments

Comments
 (0)