Skip to content

Commit 9c0305f

Browse files
committed
some internal callbacks changed to private
1 parent 44227fe commit 9c0305f

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
@@ -49,11 +49,11 @@ class ConnectionPanel implements Tracy\IBarPanel
4949

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

5555

56-
public function logQuery(Connection $connection, $result): void
56+
private function logQuery(Connection $connection, $result): void
5757
{
5858
if ($this->disabled) {
5959
return;

src/Database/SqlPreprocessor.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function process(array $params, bool $useParams = false): array
9696
$res[] = Nette\Utils\Strings::replace(
9797
$param,
9898
'~\'[^\']*+\'|"[^"]*+"|\?[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',
99-
[$this, 'callback']
99+
\Closure::fromCallable([$this, 'callback'])
100100
);
101101
} else {
102102
throw new Nette\InvalidArgumentException('There are more parameters than placeholders.');
@@ -107,8 +107,7 @@ public function process(array $params, bool $useParams = false): array
107107
}
108108

109109

110-
/** @internal */
111-
public function callback(array $m): string
110+
private function callback(array $m): string
112111
{
113112
$m = $m[0];
114113
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)