@@ -40,6 +40,9 @@ |
||
| 40 | 40 | static::$timers = []; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | + /** |
|
| 44 | + * @param string $format |
|
| 45 | + */ |
|
| 43 | 46 | final static protected function processTimerValue($value, $format) { |
| 44 | 47 | if ($value[0]) { |
| 45 | 48 | return static::formatTime((static::getCurrentTime() - $value[1]) + $value[2], $format); |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types=1); |
|
| 2 | +declare(strict_types = 1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Ayesh\PHP_Timer; |
| 5 | 5 | |
@@ -21,8 +21,7 @@ discard block |
||
| 21 | 21 | static::$timers[$key][0] = true; |
| 22 | 22 | static::$timers[$key][1] = static::getCurrentTime(); |
| 23 | 23 | } |
| 24 | - } |
|
| 25 | - else { |
|
| 24 | + } else { |
|
| 26 | 25 | static::$timers[$key] = [ |
| 27 | 26 | true, |
| 28 | 27 | static::getCurrentTime(), |
@@ -75,8 +74,7 @@ discard block |
||
| 75 | 74 | $ct = static::getCurrentTime(); |
| 76 | 75 | static::$timers[$key][0] = false; |
| 77 | 76 | static::$timers[$key][2] += $ct - static::$timers[$key][1]; |
| 78 | - } |
|
| 79 | - else { |
|
| 77 | + } else { |
|
| 80 | 78 | throw new \LogicException('Stopping timer when the given key timer was not initialized.'); |
| 81 | 79 | } |
| 82 | 80 | } |