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

Minor improvements

parent 79284701
......@@ -27,11 +27,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
......
......@@ -21,7 +21,7 @@ final class SmartyBarPanel implements Tracy\IBarPanel
*/
private $smarty;
/**
* @var PBSmarty
* @var Smarty
*/
private $currentSmarty;
......
......@@ -61,9 +61,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;
......
......@@ -8,14 +8,14 @@ use Smarty;
class TraceableSmarty extends Smarty
{
/** @var array */
private $backtraces;
private $backtraces = [];
/**
* @param array|string $tpl_var
* @param null $value
* @param bool $nocache
*
* @return Smarty_Internal_Data
* @return self
*/
public function assign($tpl_var, $value = null, $nocache = false)
{
......@@ -39,7 +39,7 @@ class TraceableSmarty extends Smarty
Registrator::getInstance($this->getCompileDir(), $this->getCacheDir())->registerSmarty($this);
}
public function getBacktraces(): array
final public function getBacktraces(): array
{
return $this->backtraces;
}
......
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