Commit 568cbea4 authored by Tomáš Pospíšil's avatar Tomáš Pospíšil
Browse files

Merge branch 'master' of gitlab.praguebest.cz:pospisil/tracyBars

# Conflicts:
#	src/BarPanel/SmartyBarPanel.php
#	src/Tools/TraceableSmarty.php
parents d6ddce83 f9f6500d
......@@ -28,11 +28,11 @@ final class Registrator
public static function getInstance(string $compileDir, string $cacheDir): Registrator
{
if (self::$instance === null) {
self::$instance = new self($compileDir, $cacheDir);
if (Registrator::$instance === null) {
Registrator::$instance = new self($compileDir, $cacheDir);
}
return self::$instance;
return Registrator::$instance;
}
public function registerDebugger(string $errorDir, string $emailDeveloper): Registrator
......
......@@ -38,9 +38,9 @@ final class DBProfiler
public static function getInstance(): self
{
self::$instance = self::$instance ?? new self();
DBProfiler::$instance = DBProfiler::$instance ?? new self();
return self::$instance;
return DBProfiler::$instance;
}
public function profilePublisher(PDOStatement $statement, ?array $placeholders, ?array $extraParams): bool
......
......@@ -36,16 +36,16 @@ final class PublisherQueryFormatter
if (is_string($a) && is_string($b)) {
return strlen($a) - strlen($b);
}
return 0;
}
);
foreach ($keys as $key => $value) {
$param = $this->_debugGetParam($value);
$param = $this->debugGetParam($value);
if ($param instanceof SqlPrepareIn) {
if ($param instanceof SqlPrepareIn && is_array($param->getData())) {
$key = $param->getSql();
$param = implode(',', $param->getData());
}
if ($param instanceof SqlPrepareIn && is_array($param->getData())) {
$key = $param->getSql();
$param = implode(',', $param->getData());
}
$sql = str_replace($key, $param, $sql);
}
......@@ -53,7 +53,11 @@ final class PublisherQueryFormatter
return $sql . ";";
}
private function _debugGetParam($param)
/**
* @param mixed $param
* @return mixed
*/
private function debugGetParam($param)
{
if (is_numeric($param)) {
return $param;
......
......@@ -37,7 +37,7 @@ class TraceableSmarty extends Smarty
* @param null $value
* @param bool $nocache
*
* @return Smarty_Internal_Data
* @return self
*/
public function assign($tpl_var, $value = null, $nocache = false)
{
......@@ -91,12 +91,12 @@ class TraceableSmarty extends Smarty
return $template;
}
public function getBacktraces(): array
final public function getBacktraces(): array
{
return $this->backtraces;
}
public function getAssigns(): array
final public function getAssigns(): array
{
$assigns = [];
foreach ($this->generatedTemplates as $template) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment