Skip to content

Commit 0a06809

Browse files
committed
Remove string interpolation; it will be deprecated in PHP 8.2
1 parent d426be3 commit 0a06809

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/CryptoEncoding/PEM.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ public function data(): string
152152
*/
153153
public function string(): string
154154
{
155-
return "-----BEGIN {$this->type}-----\n" .
156-
trim(chunk_split(base64_encode($this->data), 64, "\n")) . "\n" .
157-
"-----END {$this->type}-----";
155+
return sprintf(
156+
"-----BEGIN %s-----\n%s\n-----END %s-----",
157+
$this->type,
158+
trim(chunk_split(base64_encode($this->data), 64, "\n")),
159+
$this->type
160+
);
158161
}
159162
}

0 commit comments

Comments
 (0)