From d8a6f5b7ce8ee2ab6b34a12f53cd2be23dd62c54 Mon Sep 17 00:00:00 2001 From: vdauchy Date: Tue, 12 May 2020 14:48:40 -0400 Subject: [PATCH] Add returned value to measure() Change-Id: I52e822caaee73bfc70f93e1512710e7893bd362b --- composer.json | 2 +- src/LaravelDebugbar.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index eddc364b..a3677e48 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ ], "require": { "php": ">=7.0", - "maximebf/debugbar": "^1.15.1", + "maximebf/debugbar": "^1.16.3", "illuminate/routing": "^5.5|^6|^7", "illuminate/session": "^5.5|^6|^7", "illuminate/support": "^5.5|^6|^7", diff --git a/src/LaravelDebugbar.php b/src/LaravelDebugbar.php index 8eecec0c..a88c5437 100644 --- a/src/LaravelDebugbar.php +++ b/src/LaravelDebugbar.php @@ -900,16 +900,18 @@ public function addMeasure($label, $start, $end) * * @param string $label * @param \Closure $closure + * @return mixed */ public function measure($label, \Closure $closure) { if ($this->hasCollector('time')) { /** @var \DebugBar\DataCollector\TimeDataCollector $collector */ $collector = $this->getCollector('time'); - $collector->measure($label, $closure); + $result = $collector->measure($label, $closure); } else { - $closure(); + $result = $closure(); } + return $result; } /**