From b6a849627c0b658ea39d2949f9873311ddd06202 Mon Sep 17 00:00:00 2001 From: Dominique FOURNIER Date: Thu, 13 Apr 2023 14:12:28 +0200 Subject: [PATCH] Using ${var} in strings is deprecated, use {$var} instead --- src/Authparams.php | 2 +- src/Console.php | 10 +++++----- src/Convert.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Authparams.php b/src/Authparams.php index f83f2f6..eba68bb 100644 --- a/src/Authparams.php +++ b/src/Authparams.php @@ -115,7 +115,7 @@ class Authparams * http://localhost/rest/authentication/ | jq -r * curl -s \ * -H "Accept: application/json" \ - * -H "Authentication: Bearer ${BearerToken}" \ + * -H "Authentication: Bearer {$BearerToken}" \ * http://localhost/rest/api/ * The real verification are done in authjwt, as we can not have the * jwtServerKey defined in property : the execution is done in constructor diff --git a/src/Console.php b/src/Console.php index f385cb2..db8aa6f 100644 --- a/src/Console.php +++ b/src/Console.php @@ -350,7 +350,7 @@ class Console } foreach ($completeArr as $key => $val) { if ($isAssoc) { - printf("%-${maxlen}s %s\n", $key, $val); + printf("%-{$maxlen}s %s\n", $key, $val); } elseif (trim($val) === "") { // TODO : Define the string to display for ending string echo "
\n"; @@ -822,7 +822,7 @@ class Console $this->consoleException("ColorNum provided to colorText is not an " . "integer"); } - echo "\033[38;5;${colorNum}m"; + echo "\033[38;5;{$colorNum}m"; } /** Set the background text color @@ -834,7 +834,7 @@ class Console $this->consoleException("ColorNum provided to colorBackgroundText not " . "an integer"); } - echo "\033[48;5;${colorNum}m"; + echo "\033[48;5;{$colorNum}m"; } /** Reset the colors @@ -854,7 +854,7 @@ class Console } else { $underline = ""; } - echo "\033[${underline}4m"; + echo "\033[{$underline}4m"; } /** Bold the text @@ -867,7 +867,7 @@ class Console } else { $bold = 1; } - echo "\033[${bold}m"; + echo "\033[{$bold}m"; } /** Return true if the TTY is enabled, or false if the program is called from pipe diff --git a/src/Convert.php b/src/Convert.php index 8197fbb..68b9371 100644 --- a/src/Convert.php +++ b/src/Convert.php @@ -190,6 +190,6 @@ class Convert $display = $value; } - return sprintf("%.${decimals}f", $display) . $size[$factor] . $unit; + return sprintf("%.{$decimals}f", $display) . $size[$factor] . $unit; } }