@@ -38,8 +38,7 @@ |
||
| 38 | 38 | public static function start(string $key = 'default'): void { |
| 39 | 39 | if (isset(self::$timers[$key])) { |
| 40 | 40 | self::$timers[$key]->start(); |
| 41 | - } |
|
| 42 | - else { |
|
| 41 | + } else { |
|
| 43 | 42 | self::$timers[$key] = new Stopwatch(); |
| 44 | 43 | } |
| 45 | 44 | } |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | * @param string $key The key that the timer was started with. Default value is |
| 117 | 117 | * "default" throughout the class. |
| 118 | 118 | * @param string $format |
| 119 | - * @return mixed The formatted time. |
|
| 119 | + * @return string The formatted time. |
|
| 120 | 120 | * @throws \LogicException |
| 121 | 121 | */ |
| 122 | 122 | public static function read(string $key = 'default', $format = self::FORMAT_MILLISECONDS) { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -declare(strict_types = 1); |
|
| 2 | +declare(strict_types=1); |
|
| 3 | 3 | |
| 4 | 4 | namespace Ayesh\PHP_Timer; |
| 5 | 5 | |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | foreach (self::TIMES as $unit => $value) { |
| 98 | 98 | if ($ms >= $value) { |
| 99 | 99 | $time = floor($ms / $value * 100.0) / 100.0; |
| 100 | - return $time . ' ' . ($time == 1 ? $unit : $unit . 's'); |
|
| 100 | + return $time.' '.($time == 1 ? $unit : $unit.'s'); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - return $ms . ' ms'; |
|
| 104 | + return $ms.' ms'; |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -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 | |