Skip to content

Commit 32b8318

Browse files
committed
Update deps
1 parent 7c113da commit 32b8318

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
},
3636

3737
"require-dev" : {
38-
"jbzoo/toolbox-dev" : "^2.6.2",
38+
"jbzoo/toolbox-dev" : "^2.8.0",
3939
"jbzoo/data" : "^4.1.3",
40-
"symfony/process" : "^5.2.3",
41-
"symfony/polyfill-mbstring" : "^1.22.0"
40+
"symfony/process" : "^5.2.4",
41+
"symfony/polyfill-mbstring" : "^1.22.1"
4242
},
4343

4444
"suggest" : {

src/Timer.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@
2424
*/
2525
class Timer
2626
{
27-
/**
28-
* @var array
29-
*/
30-
private static $times = [
31-
'hour' => 3600000,
32-
'min' => 60000,
33-
'sec' => 1000,
34-
];
35-
3627
/**
3728
* Formats the elapsed time as a string.
3829
*
@@ -41,9 +32,15 @@ class Timer
4132
*/
4233
public static function format(float $milliSeconds): string
4334
{
35+
$times = [
36+
'hour' => 60 * 60 * 1000,
37+
'min' => 60 * 1000,
38+
'sec' => 1000,
39+
];
40+
4441
$time = round($milliSeconds * 1000);
4542

46-
foreach (self::$times as $unit => $value) {
43+
foreach ($times as $unit => $value) {
4744
if ($time >= $value) {
4845
$time = floor($time / $value * 100.0) / 100.0;
4946
return $time . ' ' . $unit . ($time === 1.0 ? '' : 's');

0 commit comments

Comments
 (0)