TimingsHandler: throw on attempt to stop timer that is not running

I do not think that this bug is in effect in the core code, but I can't be sure.
This commit is contained in:
Dylan K. Taylor 2019-12-21 13:17:25 +00:00
parent 8726604899
commit d83820477f

View File

@ -168,6 +168,9 @@ class TimingsHandler{
public function stopTiming(){
if(self::$enabled){
if($this->timingDepth === 0){
throw new \InvalidStateException("Cannot stop a timer that is not running");
}
if(--$this->timingDepth !== 0 or $this->start == 0){
return;
}