Skip to content

Commit

Permalink
Merge pull request #10 from mpesari/fix-deprecated-string-interpolation
Browse files Browse the repository at this point in the history
PHP 8.2: Fix deprecated string interpolation
  • Loading branch information
Bilge committed Dec 13, 2022
2 parents 272b117 + 2a45b54 commit aa943ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/CI.yml
Expand Up @@ -14,6 +14,7 @@ jobs:
fail-fast: false
matrix:
php:
- 8.2
- 8.1
- 8.0
dependencies:
Expand All @@ -28,6 +29,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
coverage: xdebug
ini-values: error_reporting=-1

- name: Validate composer.json
run: composer validate
Expand Down
2 changes: 1 addition & 1 deletion src/Byte/ByteFormatter.php
Expand Up @@ -72,7 +72,7 @@ public function format(int|float $bytes, int $precision = null): string
*/
private function formatValue(float $value, int $precision): string
{
$formatted = sprintf("%0.${precision}F", $value);
$formatted = sprintf("%0.{$precision}F", $value);

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

0 comments on commit aa943ef

Please sign in to comment.