mirror of
https://github.com/maximebf/php-debugbar.git
synced 2025-01-17 13:28:35 +01:00
Fix missing phpdocs in TimeDataCollector, rename new method name
This commit is contained in:
parent
e4414bf296
commit
0dc7d01442
@ -18,12 +18,25 @@ use DebugBar\DebugBarException;
|
||||
*/
|
||||
class TimeDataCollector extends DataCollector implements Renderable
|
||||
{
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
protected $requestStartTime;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*/
|
||||
protected $requestEndTime;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $startedMeasures = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $measures = array();
|
||||
|
||||
/**
|
||||
@ -62,7 +75,7 @@ class TimeDataCollector extends DataCollector implements Renderable
|
||||
* @param string $name
|
||||
* @return bool
|
||||
*/
|
||||
public function hasMeasure($name)
|
||||
public function hasStartedMeasure($name)
|
||||
{
|
||||
return isset($this->startedMeasures[$name]);
|
||||
}
|
||||
@ -75,7 +88,7 @@ class TimeDataCollector extends DataCollector implements Renderable
|
||||
public function stopMeasure($name)
|
||||
{
|
||||
$end = microtime(true);
|
||||
if (!$this->hasMeasure($name)) {
|
||||
if (!$this->hasStartedMeasure($name)) {
|
||||
throw new DebugBarException("Failed stopping measure '$name' because it hasn't been started");
|
||||
}
|
||||
$this->addMeasure($this->startedMeasures[$name]['label'], $this->startedMeasures[$name]['start'], $end);
|
||||
|
Loading…
x
Reference in New Issue
Block a user