From e98c06eb05a084cb43832d4bc3f034bb44913c61 Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 13 Apr 2020 22:58:17 +0530 Subject: [PATCH] Fix errors reported by psalm --- src/DebugSql.php | 1 + src/DebugTimer.php | 2 +- src/Panel/DeprecationsPanel.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/DebugSql.php b/src/DebugSql.php index 2225c11ec..72d3c843f 100644 --- a/src/DebugSql.php +++ b/src/DebugSql.php @@ -76,6 +76,7 @@ public static function sql(Query $query, $showValues = true, $showHtml = null, $ $sql = static::interpolate($sql, $query->getValueBinder()->bindings()); } + /** @var array $trace */ $trace = Debugger::trace(['start' => 1, 'depth' => $stackDepth + 2, 'format' => 'array']); $file = isset($trace[$stackDepth]) ? $trace[$stackDepth]['file'] : 'n/a'; $line = isset($trace[$stackDepth]) ? $trace[$stackDepth]['line'] : 0; diff --git a/src/DebugTimer.php b/src/DebugTimer.php index 76a5cc9eb..23e8deef9 100644 --- a/src/DebugTimer.php +++ b/src/DebugTimer.php @@ -211,6 +211,6 @@ public static function requestStartTime() $startTime = env('REQUEST_TIME'); } - return $startTime; + return (float)$startTime; } } diff --git a/src/Panel/DeprecationsPanel.php b/src/Panel/DeprecationsPanel.php index 92bda2459..3ee9e0932 100644 --- a/src/Panel/DeprecationsPanel.php +++ b/src/Panel/DeprecationsPanel.php @@ -138,7 +138,7 @@ public function summary() $data = $this->_prepare(); } - return array_reduce($data, function ($carry, $item) { + return (string)array_reduce($data, function ($carry, $item) { if (empty($item)) { return $carry; }