Skip to content

Commit aa943ef

Browse files
authored
Merge pull request #10 from mpesari/fix-deprecated-string-interpolation
PHP 8.2: Fix deprecated string interpolation
2 parents 272b117 + 2a45b54 commit aa943ef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
php:
17+
- 8.2
1718
- 8.1
1819
- 8.0
1920
dependencies:
@@ -28,6 +29,7 @@ jobs:
2829
with:
2930
php-version: ${{ matrix.php }}
3031
coverage: xdebug
32+
ini-values: error_reporting=-1
3133

3234
- name: Validate composer.json
3335
run: composer validate

src/Byte/ByteFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function format(int|float $bytes, int $precision = null): string
7272
*/
7373
private function formatValue(float $value, int $precision): string
7474
{
75-
$formatted = sprintf("%0.${precision}F", $value);
75+
$formatted = sprintf("%0.{$precision}F", $value);
7676

7777
if ($this->hasAutomaticPrecision()) {
7878
// [0 => integer part, 1 => fractional part].

0 commit comments

Comments
 (0)