mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-16 16:55:28 +00:00
Merge branch 'master' into php-7.4
# Conflicts: # composer.json # src/Output/QROutputAbstract.php # src/QROptionsTrait.php
This commit is contained in:
@@ -14,6 +14,8 @@ namespace chillerlan\QRCode\Data;
|
||||
|
||||
use chillerlan\QRCode\QRCode;
|
||||
|
||||
use function array_search, ord, sprintf;
|
||||
|
||||
/**
|
||||
* Alphanumeric mode: 0 to 9, A to Z, space, $ % * + - . / :
|
||||
*/
|
||||
@@ -42,13 +44,13 @@ class AlphaNum extends QRDataAbstract{
|
||||
* @throws \chillerlan\QRCode\Data\QRCodeDataException
|
||||
*/
|
||||
protected function getCharCode(string $chr):int{
|
||||
$i = \array_search($chr, $this::ALPHANUM_CHAR_MAP);
|
||||
$i = array_search($chr, $this::ALPHANUM_CHAR_MAP);
|
||||
|
||||
if($i !== false){
|
||||
return $i;
|
||||
}
|
||||
|
||||
throw new QRCodeDataException('illegal char: "'.$chr.'" ['.\ord($chr).']');
|
||||
throw new QRCodeDataException(sprintf('illegal char: "%s" [%d]', $chr, ord($chr)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user