Просмотр исходного кода

:octocat: +max length table reference

codemasher 5 лет назад
Родитель
Сommit
0c318f7ef6
1 измененных файлов с 14 добавлено и 0 удалено
  1. 14 0
      src/Common/Mode.php

+ 14 - 0
src/Common/Mode.php

@@ -65,6 +65,20 @@ final class Mode{
 		self::DATA_BYTE     => Byte::class,
 	];
 
+	/**
+	 * References to the keys of the following table(s):
+	 *
+	 * @see \chillerlan\QRCode\Common\Version::MAX_LENGTH
+	 *
+	 * @var int[]
+	 */
+	public const DATA_MODES = [
+		self::DATA_NUMBER   => 0,
+		self::DATA_ALPHANUM => 1,
+		self::DATA_BYTE     => 2,
+		self::DATA_KANJI    => 3,
+	];
+
 	/**
 	 * returns the length bits for the version breakpoints 1-9, 10-26 and 27-40
 	 *