@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param bool $readable Whether the result must be human-readable. |
| 43 | 43 | * @param null|string $format The format to display (printf format). |
| 44 | 44 | */ |
| 45 | - public function getMemoryPeak(bool $readable = false, null|string $format = null): int|string; |
|
| 45 | + public function getMemoryPeak(bool $readable = false, null | string $format = null): int | string; |
|
| 46 | 46 | |
| 47 | 47 | /** |
| 48 | 48 | * Returns the memory usage at the end checkpoint. |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @throws LogicException Should be thrown if end() and/or start() has not been called. |
| 54 | 54 | * Can be checked with hasStarted() and hasEnded(). |
| 55 | 55 | */ |
| 56 | - public function getMemoryUsage(bool $readable = false, null|string $format = null): int|string; |
|
| 56 | + public function getMemoryUsage(bool $readable = false, null | string $format = null): int | string; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Returns the elapsed time, readable or not. |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * @throws LogicException Should be thrown if end() and/or start() has not been called. |
| 65 | 65 | * Can be checked with hasStarted() and hasEnded(). |
| 66 | 66 | */ |
| 67 | - public function getTime(bool $readable = false, null|string $format = null): float|string; |
|
| 67 | + public function getTime(bool $readable = false, null | string $format = null): float | string; |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Checks if a bench has ended. |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @param null|string $format The format to display (printf format). |
| 99 | 99 | * @param int $round Rounding precision (decimals). |
| 100 | 100 | */ |
| 101 | - public static function readableElapsedTime(float $seconds, null|string $format = null, int $round = 3): string; |
|
| 101 | + public static function readableElapsedTime(float $seconds, null | string $format = null, int $round = 3): string; |
|
| 102 | 102 | |
| 103 | 103 | /** |
| 104 | 104 | * Returns a human-readable memory size. |
@@ -107,5 +107,5 @@ discard block |
||
| 107 | 107 | * @param null|string $format The format to display (printf format). |
| 108 | 108 | * @param int $round Rounding precision (decimals). |
| 109 | 109 | */ |
| 110 | - public static function readableSize(int $size, null|string $format = null, int $round = 3): string; |
|
| 110 | + public static function readableSize(int $size, null | string $format = null, int $round = 3): string; |
|
| 111 | 111 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | /** |
| 71 | 71 | * @inheritDoc |
| 72 | 72 | */ |
| 73 | - public function getMemoryPeak(bool $readable = false, null|string $format = null): int|string |
|
| 73 | + public function getMemoryPeak(bool $readable = false, null | string $format = null): int | string |
|
| 74 | 74 | { |
| 75 | 75 | $memory = memory_get_peak_usage(true); |
| 76 | 76 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * @inheritDoc |
| 86 | 86 | */ |
| 87 | - public function getMemoryUsage(bool $readable = false, null|string $format = null): int|string |
|
| 87 | + public function getMemoryUsage(bool $readable = false, null | string $format = null): int | string |
|
| 88 | 88 | { |
| 89 | 89 | if (!$this->hasStarted()) { |
| 90 | 90 | throw new LogicException('Bench has not been started. Call start() first.'); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | /** |
| 105 | 105 | * @inheritDoc |
| 106 | 106 | */ |
| 107 | - public function getTime(bool $readable = false, null|string $format = null): float|string |
|
| 107 | + public function getTime(bool $readable = false, null | string $format = null): float | string |
|
| 108 | 108 | { |
| 109 | 109 | if (!$this->hasStarted()) { |
| 110 | 110 | throw new LogicException('Bench has not been started. Call start() first.'); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | /** |
| 169 | 169 | * @inheritDoc |
| 170 | 170 | */ |
| 171 | - public static function readableElapsedTime(float $seconds, null|string $format = null, int $round = 3): string |
|
| 171 | + public static function readableElapsedTime(float $seconds, null | string $format = null, int $round = 3): string |
|
| 172 | 172 | { |
| 173 | 173 | $format ??= '%.3f%s'; |
| 174 | 174 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | /** |
| 185 | 185 | * @inheritDoc |
| 186 | 186 | */ |
| 187 | - public static function readableSize(int $size, null|string $format = null, int $round = 3): string |
|
| 187 | + public static function readableSize(int $size, null | string $format = null, int $round = 3): string |
|
| 188 | 188 | { |
| 189 | 189 | /** |
| 190 | 190 | * @psalm-var array<array-key, string> $units |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | do { |
| 208 | 208 | ++$unit; |
| 209 | 209 | $size /= $mod; |
| 210 | - } while($size > $mod); |
|
| 210 | + } while ($size > $mod); |
|
| 211 | 211 | |
| 212 | 212 | return sprintf($format, round($size, $round), $units[$unit]); |
| 213 | 213 | } |