escpos-tools
escpos-tools copied to clipboard
Update to PHP 8.0
When running esc2html with PHP v8.2.9 on MacOS I got some warnings and errors:
PHP Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /Users/pharkas/code/escpos-tools/esc2html.php on line 104
PHP Fatal error: Uncaught TypeError: implode(): Argument #1 ($separator) must be of type string, array given in /Users/pharkas/code/escpos-tools/esc2html.php:63
It looks like the old implode(array $array, string $separator): string API was removed in PHP 8.0.0, but the fix is simple- just swap the arguments. I also fixed the warning about ${var} in strings being deprecated.
I ran a code style check with php vendor/bin/phpcs --standard=psr2 src/ -n but got an error because php_codesniffer was out of date, so I bumped it up to ^3.0
Reviewd it works well, thank you. Someone should really merge that.
I can also add/confirm that this allowed me to use esc2html with PHP 8.0.