Skip to content

Commit edb34bf

Browse files
author
Karel Wintersky
committed
2.0.0
- PHP8 version - New Classes, that implements PDO
1 parent 7fa8eae commit edb34bf

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

interfaces/Database/StatsInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@ public function getSlowQueries():array;
2121
public function getLastQuery(): ?array;
2222

2323
public function reset(): void;
24+
25+
public static function formatTime($time = 0, int $decimals = 6, string $decimal_separator = '.', string $thousands_separator = ''): string;
2426
}

sources/Database/Config.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,6 @@ public function setSlowQueryThreshold(mixed $value, bool $as_ms = true):self
196196
return $this;
197197
}
198198

199-
/**
200-
* @param $time (float|string|int)
201-
* @param int $decimals
202-
* @param string $decimal_separator
203-
* @param string $thousands_separator
204-
* @return string
205-
*/
206-
public function __formatTime($time = 0, int $decimals = 6, string $decimal_separator = '.', string $thousands_separator = ''): string
207-
{
208-
return \number_format($time, $decimals, $decimal_separator, $thousands_separator);
209-
}
199+
210200

211201
}

sources/Database/Stats.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ class Stats implements StatsInterface
77
private ?Config $config;
88

99
private int $queryCount = 0;
10-
1110
private int $preparedQueryCount = 0;
11+
1212
private float $totalQueryTime = 0.0;
1313
private float $totalQueryCount = 0;
1414

@@ -125,4 +125,16 @@ public function reset(): void
125125
$this->queries = [];
126126
$this->slowQueries = [];
127127
}
128+
129+
/**
130+
* @param $time (float|string|int)
131+
* @param int $decimals
132+
* @param string $decimal_separator
133+
* @param string $thousands_separator
134+
* @return string
135+
*/
136+
public static function formatTime($time = 0, int $decimals = 6, string $decimal_separator = '.', string $thousands_separator = ''): string
137+
{
138+
return \number_format($time, $decimals, $decimal_separator, $thousands_separator);
139+
}
128140
}

0 commit comments

Comments
 (0)