mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-10-16 16:55:28 +00:00
:octocat: fix PHPCS config, add Slevomat rules
This commit is contained in:
+2
-12
@@ -27,7 +27,9 @@ final class AlphaNum extends QRDataModeAbstract{
|
||||
* @var int[]
|
||||
*/
|
||||
private const CHAR_TO_ORD = [
|
||||
// phpcs:ignore
|
||||
'0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7,
|
||||
// phpcs:ignore
|
||||
'8' => 8, '9' => 9, 'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15,
|
||||
'G' => 16, 'H' => 17, 'I' => 18, 'J' => 19, 'K' => 20, 'L' => 21, 'M' => 22, 'N' => 23,
|
||||
'O' => 24, 'P' => 25, 'Q' => 26, 'R' => 27, 'S' => 28, 'T' => 29, 'U' => 30, 'V' => 31,
|
||||
@@ -47,21 +49,12 @@ final class AlphaNum extends QRDataModeAbstract{
|
||||
'+', '-', '.', '/', ':',
|
||||
];
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public const DATAMODE = Mode::ALPHANUM;
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getLengthInBits():int{
|
||||
return (int)ceil($this->getCharCount() * (11 / 2));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function validateString(string $string):bool{
|
||||
|
||||
if($string === ''){
|
||||
@@ -77,9 +70,6 @@ final class AlphaNum extends QRDataModeAbstract{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function write(BitBuffer $bitBuffer, int $versionNumber):static{
|
||||
$len = $this->getCharCount();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user