PHP 8.2 issue with `${var}` declarations
scottchiefbaker opened this issue · comments
FYI:
PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/scott/rats/GoogleAuthenticator/PHPGangsta/GoogleAuthenticator.php on line 112
Super easy fix.
English (machine translation):
I'm also experiencing this issue, but judging by the activity, it shouldn't be maintained anymore, so I'll have to deal with it on my own.
The way I handled it is as follows, hopefully it can be a reference for people encountering the same problem:
Comment out line 112 and replace it with the following:
return sprintf('https://api.qrserver.com/v1/create-qr-code/?data=%s&size=%dx%d&ecc=%s',
$urlencoded, $width, $height, $level);
If you don't use this method getQRCodeGoogleUrl()
, you can also just delete the part I selected.
中文回复:
我也遇到了这个问题,不过从活跃度上看,应该不在维护了,只能自行处理了。
我的处理方法如下,希望可以给遇到相同问题的人们一个参考:
将 112 行注释,并替为如下写法:
return sprintf('https://api.qrserver.com/v1/create-qr-code/?data=%s&size=%dx%d&ecc=%s',
$urlencoded, $width, $height, $level);
如果并没有使用此方法 getQRCodeGoogleUrl()
,也可以直接删除我选中的部分