1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-01-17 21:38:14 +01:00

Fix missing phpdocs in TimeDataCollector, rename new method name

This commit is contained in:
snapshotpl 2014-03-29 15:03:41 +01:00
parent e4414bf296
commit 0dc7d01442

View File

@ -18,12 +18,25 @@ use DebugBar\DebugBarException;
*/ */
class TimeDataCollector extends DataCollector implements Renderable class TimeDataCollector extends DataCollector implements Renderable
{ {
/**
* @var float
*/
protected $requestStartTime; protected $requestStartTime;
/**
* @var float
*/
protected $requestEndTime; protected $requestEndTime;
/**
* @var array
*/
protected $startedMeasures = array(); protected $startedMeasures = array();
/**
* @var array
*/
protected $measures = array(); protected $measures = array();
/** /**
@ -62,7 +75,7 @@ class TimeDataCollector extends DataCollector implements Renderable
* @param string $name * @param string $name
* @return bool * @return bool
*/ */
public function hasMeasure($name) public function hasStartedMeasure($name)
{ {
return isset($this->startedMeasures[$name]); return isset($this->startedMeasures[$name]);
} }
@ -75,7 +88,7 @@ class TimeDataCollector extends DataCollector implements Renderable
public function stopMeasure($name) public function stopMeasure($name)
{ {
$end = microtime(true); $end = microtime(true);
if (!$this->hasMeasure($name)) { if (!$this->hasStartedMeasure($name)) {
throw new DebugBarException("Failed stopping measure '$name' because it hasn't been started"); throw new DebugBarException("Failed stopping measure '$name' because it hasn't been started");
} }
$this->addMeasure($this->startedMeasures[$name]['label'], $this->startedMeasures[$name]['start'], $end); $this->addMeasure($this->startedMeasures[$name]['label'], $this->startedMeasures[$name]['start'], $end);