Skip to content

Commit 5a0a71a

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

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

lib/CryptoEncoding/PEM.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,13 @@ 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' .
157+
'%s\n' .
158+
'-----END %s-----",
159+
$this->type,
160+
trim(chunk_split(base64_encode($this->data), 64, "\n")),
161+
$this->type
162+
);
158163
}
159164
}

0 commit comments

Comments
 (0)