unknownEncodingDataProvider()
@@ -295,14 +225,14 @@ we'll use this test to check for the upper end of the accepted input range<
- versionBreakpointProvider()
+ versionBreakpointProvider()
: array<string|int, mixed>
returns versions within the version breakpoints 1-9, 10-26 and 27-40
- setUp()
+ setUp()
: void
@@ -334,50 +264,16 @@ we'll use this test to check for the upper end of the accepted input range<
-protected
"
>
-
- $FQN
-
+
+ $QRData
+
-
-
-
- protected
- string
- $FQN
- = \chillerlan\QRCode\Data\ECI::class
-
-
-
-
-
-
-
-
-
-
- $QRData
-
-
-
-
-
@@ -411,7 +307,7 @@ we'll use this test to check for the upper end of the accepted input range<
@@ -445,7 +341,7 @@ we'll use this test to check for the upper end of the accepted input range<
@@ -483,7 +379,7 @@ we'll use this test to check for the upper end of the accepted input range<
@@ -502,177 +398,6 @@ we'll use this test to check for the upper end of the accepted input range<
—
-
-
-
- maskPatternProvider()
-
-
-
-
-
-
- public
- static maskPatternProvider() : array<string|int, array<string|int, int>>
-
-
-
-
-
-
- -
- see
-
- -
- testInitMatrix()
-
-
-
-
-
- Return values
- array<string|int, array<string|int, int>>
- —
-
-
-
-
-
- stringValidateProvider()
-
-
-
-
-
-
- public
- static stringValidateProvider() : array<string|int, mixed>
-
-
-
-
-
-
- Return values
- array<string|int, mixed>
- —
-
-
-
-
-
- testBinaryStringInvalid()
-
-
-
-
- Tests if a binary string is properly validated as false
-
-
- public
- testBinaryStringInvalid() : void
-
-
-
-
-
-
- -
- inheritDoc
-
- -
-
-
-
-
-
- Return values
- void
- —
-
-
-
-
-
- testCodeLengthOverflowException()
-
-
-
-
- Tests if an exception is thrown on data overflow
-
-
- public
- testCodeLengthOverflowException() : void
-
-
-
-
-
-
- -
- inheritDoc
-
- -
-
-
-
-
-
- Return values
- void
- —
-
-
ECITest.php
:
- 182
+ 148
@@ -754,12 +479,11 @@ we'll use this test to check for the upper end of the accepted input range<
- Verifies the QRDataModeInterface instance
-
+
public
testDataModeInstance() : void
@@ -800,7 +524,7 @@ we'll use this test to check for the upper end of the accepted input range<
@@ -833,12 +557,11 @@ we'll use this test to check for the upper end of the accepted input range<
- Tests decoding a data segment from a given BitBuffer
-
+
public
testDecodeSegment(int $version) : void
@@ -885,197 +608,6 @@ we'll use this test to check for the upper end of the accepted input range<
—
-
-
-
- testGetMinimumVersion()
-
-
-
-
- Tests getting the minimum QR version for the given data
-
-
- public
- testGetMinimumVersion() : void
-
-
-
-
-
-
- -
- inheritDoc
-
- -
-
-
-
-
-
- Return values
- void
- —
-
-
-
-
-
- testGetMinimumVersionException()
-
-
-
-
- Tests if an exception is thrown when the data exceeds the maximum version while auto-detecting
-
-
- public
- testGetMinimumVersionException() : void
-
-
-
-
-
-
- -
- inheritDoc
-
- -
-
-
-
-
-
- Return values
- void
- —
-
-
-
-
-
- testInitMatrix()
-
-
-
-
- Tests initializing the data matrix
-
-
- public
- testInitMatrix(int $maskPattern) : void
-
-
- Parameters
-
- -
- $maskPattern
- : int
-
- -
-
-
-
-
-
-
-
-
- -
- inheritDoc
-
- -
-
-
-
- -
- dataProvider
-
- -
-
-
-
-
-
-
- Return values
- void
- —
-
-
-
-
-
- testInstance()
-
-
-
-
- Verifies the QRData instance
-
-
- public
- testInstance() : void
-
-
-
-
-
- Return values
- void
- —
-
-
ECITest.php
:
- 106
+ 74
- Tests if an exception is thrown when an invalid character is encountered
-
+
public
testInvalidDataException() : void
@@ -1136,7 +667,7 @@ we'll use this test to check for the upper end of the accepted input range<
@@ -1183,7 +714,7 @@ we'll use this test to check for the upper end of the accepted input range<
@@ -1235,73 +766,6 @@ we'll use this test to check for the upper end of the accepted input range<
—
-
-
-
- testValidateString()
-
-
-
-
- Tests if a string is properly validated for the respective data mode
-
-
- public
- testValidateString(string $string, bool $expected) : void
-
-
- Parameters
-
- -
- $string
- : string
-
- -
-
-
-
- -
- $expected
- : bool
-
- -
-
-
-
-
-
-
-
-
- -
- dataProvider
-
- -
-
-
-
-
-
-
- Return values
- void
- —
-
-
ECITest.php
:
- 170
+ 136
@@ -1344,12 +808,12 @@ we'll use this test to check for the upper end of the accepted input range<
>
versionBreakpointProvider()
-
+
@@ -1377,12 +841,12 @@ we'll use this test to check for the upper end of the accepted input range<
>
setUp()
-
+
@@ -1415,7 +879,7 @@ we'll use this test to check for the upper end of the accepted input range<
diff --git a/classes/chillerlan-QRCodeTest-Data-HanziTest.html b/classes/chillerlan-QRCodeTest-Data-HanziTest.html
index 25eba48f3..75ebc915d 100644
--- a/classes/chillerlan-QRCodeTest-Data-HanziTest.html
+++ b/classes/chillerlan-QRCodeTest-Data-HanziTest.html
@@ -140,6 +140,13 @@
-
+ $dataMode
+
+ : QRDataModeInterface
+
+
+
+ -
$FQN
: string
@@ -160,7 +167,21 @@
+ -
+ $MAX_LENGTH
+
+ : array<string|int, mixed>
+
+- ISO/IEC 18004:2000 Tables 7-11 - Number of symbol characters and input data capacity for versions 1 to 40
+
-
+ getMaxLengthForMode()
+
+ : int
+
+- the maximum character count for the given $mode and $eccLevel
+
+ -
hanziProvider()
: Generator
@@ -174,6 +195,13 @@
+ -
+ maxLengthProvider()
+
+ : Generator
+
+- Generates test data for each data mode:
+
-
stringValidateProvider()
@@ -188,13 +216,6 @@
- Tests if a binary string is properly validated as false
- -
- testCodeLengthOverflowException()
-
- : void
-
-- Tests if an exception is thrown on data overflow
-
-
testDataModeInstance()
@@ -251,6 +272,20 @@
- Tests if an exception is thrown if the given string is empty
+ -
+ testMaxLength()
+
+ : void
+
+
+
+ -
+ testMaxLengthOverflowException()
+
+ : void
+
+- Tests if an exception is thrown on data overflow
+
-
testValidateGB2312()
@@ -297,6 +332,40 @@
-property
-protected
"
+>
+
+ $dataMode
+
+
+
+
+
+
+
+
+ protected
+ QRDataModeInterface
+ $dataMode
+
+
+
+
+
+
+
+
+
+
$FQN
@@ -314,7 +383,7 @@
protected
- string
+ static string
$FQN
= \chillerlan\QRCode\Data\Hanzi::class
@@ -341,7 +410,7 @@
@@ -364,7 +433,7 @@
phpdocumentor-element
-property
-protected
- "
+ -static "
>
$testdata
@@ -382,7 +451,7 @@
protected
- string
+ static string
$testdata
= '无可奈何燃花作香'
@@ -392,6 +461,95 @@
+
+
+
+ $MAX_LENGTH
+
+
+
+
+
+
+ ISO/IEC 18004:2000 Tables 7-11 - Number of symbol characters and input data capacity for versions 1 to 40
+
+
+ private
+ static array<string|int, mixed>
+ $MAX_LENGTH
+ = [
+ // v => [NUMERIC => [L, M, Q, H ], ALPHANUM => [L, M, Q, H], BINARY => [L, M, Q, H ], KANJI => [L, M, Q, H ]]
+ 1 => [[41, 34, 27, 17], [25, 20, 16, 10], [17, 14, 11, 7], [10, 8, 7, 4]],
+ 2 => [[77, 63, 48, 34], [47, 38, 29, 20], [32, 26, 20, 14], [20, 16, 12, 8]],
+ 3 => [[127, 101, 77, 58], [77, 61, 47, 35], [53, 42, 32, 24], [32, 26, 20, 15]],
+ 4 => [[187, 149, 111, 82], [114, 90, 67, 50], [78, 62, 46, 34], [48, 38, 28, 21]],
+ 5 => [[255, 202, 144, 106], [154, 122, 87, 64], [106, 84, 60, 44], [65, 52, 37, 27]],
+ 6 => [[322, 255, 178, 139], [195, 154, 108, 84], [134, 106, 74, 58], [82, 65, 45, 36]],
+ 7 => [[370, 293, 207, 154], [224, 178, 125, 93], [154, 122, 86, 64], [95, 75, 53, 39]],
+ 8 => [[461, 365, 259, 202], [279, 221, 157, 122], [192, 152, 108, 84], [118, 93, 66, 52]],
+ 9 => [[552, 432, 312, 235], [335, 262, 189, 143], [230, 180, 130, 98], [141, 111, 80, 60]],
+ 10 => [[652, 513, 364, 288], [395, 311, 221, 174], [271, 213, 151, 119], [167, 131, 93, 74]],
+ 11 => [[772, 604, 427, 331], [468, 366, 259, 200], [321, 251, 177, 137], [198, 155, 109, 85]],
+ 12 => [[883, 691, 489, 374], [535, 419, 296, 227], [367, 287, 203, 155], [226, 177, 125, 96]],
+ 13 => [[1022, 796, 580, 427], [619, 483, 352, 259], [425, 331, 241, 177], [262, 204, 149, 109]],
+ 14 => [[1101, 871, 621, 468], [667, 528, 376, 283], [458, 362, 258, 194], [282, 223, 159, 120]],
+ 15 => [[1250, 991, 703, 530], [758, 600, 426, 321], [520, 412, 292, 220], [320, 254, 180, 136]],
+ 16 => [[1408, 1082, 775, 602], [854, 656, 470, 365], [586, 450, 322, 250], [361, 277, 198, 154]],
+ 17 => [[1548, 1212, 876, 674], [938, 734, 531, 408], [644, 504, 364, 280], [397, 310, 224, 173]],
+ 18 => [[1725, 1346, 948, 746], [1046, 816, 574, 452], [718, 560, 394, 310], [442, 345, 243, 191]],
+ 19 => [[1903, 1500, 1063, 813], [1153, 909, 644, 493], [792, 624, 442, 338], [488, 384, 272, 208]],
+ 20 => [[2061, 1600, 1159, 919], [1249, 970, 702, 557], [858, 666, 482, 382], [528, 410, 297, 235]],
+ 21 => [[2232, 1708, 1224, 969], [1352, 1035, 742, 587], [929, 711, 509, 403], [572, 438, 314, 248]],
+ 22 => [[2409, 1872, 1358, 1056], [1460, 1134, 823, 640], [1003, 779, 565, 439], [618, 480, 348, 270]],
+ 23 => [[2620, 2059, 1468, 1108], [1588, 1248, 890, 672], [1091, 857, 611, 461], [672, 528, 376, 284]],
+ 24 => [[2812, 2188, 1588, 1228], [1704, 1326, 963, 744], [1171, 911, 661, 511], [721, 561, 407, 315]],
+ 25 => [[3057, 2395, 1718, 1286], [1853, 1451, 1041, 779], [1273, 997, 715, 535], [784, 614, 440, 330]],
+ 26 => [[3283, 2544, 1804, 1425], [1990, 1542, 1094, 864], [1367, 1059, 751, 593], [842, 652, 462, 365]],
+ 27 => [[3517, 2701, 1933, 1501], [2132, 1637, 1172, 910], [1465, 1125, 805, 625], [902, 692, 496, 385]],
+ 28 => [[3669, 2857, 2085, 1581], [2223, 1732, 1263, 958], [1528, 1190, 868, 658], [940, 732, 534, 405]],
+ 29 => [[3909, 3035, 2181, 1677], [2369, 1839, 1322, 1016], [1628, 1264, 908, 698], [1002, 778, 559, 430]],
+ 30 => [[4158, 3289, 2358, 1782], [2520, 1994, 1429, 1080], [1732, 1370, 982, 742], [1066, 843, 604, 457]],
+ 31 => [[4417, 3486, 2473, 1897], [2677, 2113, 1499, 1150], [1840, 1452, 1030, 790], [1132, 894, 634, 486]],
+ 32 => [[4686, 3693, 2670, 2022], [2840, 2238, 1618, 1226], [1952, 1538, 1112, 842], [1201, 947, 684, 518]],
+ 33 => [[4965, 3909, 2805, 2157], [3009, 2369, 1700, 1307], [2068, 1628, 1168, 898], [1273, 1002, 719, 553]],
+ 34 => [[5253, 4134, 2949, 2301], [3183, 2506, 1787, 1394], [2188, 1722, 1228, 958], [1347, 1060, 756, 590]],
+ 35 => [[5529, 4343, 3081, 2361], [3351, 2632, 1867, 1431], [2303, 1809, 1283, 983], [1417, 1113, 790, 605]],
+ 36 => [[5836, 4588, 3244, 2524], [3537, 2780, 1966, 1530], [2431, 1911, 1351, 1051], [1496, 1176, 832, 647]],
+ 37 => [[6153, 4775, 3417, 2625], [3729, 2894, 2071, 1591], [2563, 1989, 1423, 1093], [1577, 1224, 876, 673]],
+ 38 => [[6479, 5039, 3599, 2735], [3927, 3054, 2181, 1658], [2699, 2099, 1499, 1139], [1661, 1292, 923, 701]],
+ 39 => [[6743, 5313, 3791, 2927], [4087, 3220, 2298, 1774], [2809, 2213, 1579, 1219], [1729, 1362, 972, 750]],
+ 40 => [[7089, 5596, 3993, 3057], [4296, 3391, 2420, 1852], [2953, 2331, 1663, 1273], [1817, 1435, 1024, 784]],
+]
+
+
+
+
+
+
+ -
+ see
+
+ -
+ http://www.qrcode.com/en/about/version.html
+
+
+
+
+
@@ -405,6 +563,96 @@
-method
-public
-static "
+>
+
+
+
+
the maximum character count for the given $mode and $eccLevel
+
+
+ public
+ static getMaxLengthForMode(int $mode, Version $version, EccLevel $eccLevel) : int
+
+
+ Parameters
+
+ -
+ $mode
+ : int
+
+ -
+
+
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+
+
+
+
+
+ -
+ todo:
+
+ -
+
+
this methood is only used in unit tests (incl. MAX_LENGTH table)
+
+
+
+ -
+ throws
+
+ -
+ QRCodeException
+
+
+
+ -
+ codeCoverageIgnore
+
+ -
+
+
+
+
+
+ Return values
+ int
+ —
+
+
+
+
hanziProvider()
@@ -446,7 +694,7 @@
@@ -458,23 +706,64 @@
+
+ Return values
+ array<string|int, array<string|int, int>>
+ —
+
+
+
+
+
+ maxLengthProvider()
+
+
+
+
+ Generates test data for each data mode:
+
+
+ public
+ static maxLengthProvider() : Generator
+
+
+- version
+- ECC level
+- a string that contains the maximum amount of characters for the given mode
+- a string that contains characters for the given mode and that exceeds the maximum length by one/two character(s)
+- the maximum allowed character length
+
+
+
+
+
-
- see
+ throws
-
- testInitMatrix()
-
+ Exception
+
Return values
- array<string|int, array<string|int, int>>
+ Generator
—
@@ -525,7 +814,7 @@
@@ -558,39 +847,6 @@
—
-
-
-
- testCodeLengthOverflowException()
-
-
-
-
- Tests if an exception is thrown on data overflow
-
-
- public
- testCodeLengthOverflowException() : void
-
-
-
-
-
- Return values
- void
- —
-
-
DataInterfaceTestAbstract.php
:
- 45
+ 54
@@ -638,7 +894,7 @@
@@ -697,7 +953,7 @@
@@ -705,11 +961,53 @@
public
- testGetMinimumVersion() : void
+ testGetMinimumVersion(Version $version, EccLevel $eccLevel, string $str) : void
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+
+
-
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
Return values
void
@@ -730,7 +1028,7 @@
@@ -763,7 +1061,7 @@
@@ -822,7 +1120,7 @@
@@ -855,7 +1153,7 @@
@@ -888,7 +1186,7 @@
@@ -907,6 +1205,163 @@
—
+
+
+
+ testMaxLength()
+
+
+
+
+
+
+ public
+ testMaxLength(Version $version, EccLevel $eccLevel, string $str) : void
+
+
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+
+
+
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ testMaxLengthOverflowException()
+
+
+
+
+ Tests if an exception is thrown on data overflow
+
+
+ public
+ testMaxLengthOverflowException(Version $version, EccLevel $eccLevel, string $str, string $str1) : void
+
+
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+ -
+ $str1
+ : string
+
+ -
+
+
+
+
+
+
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
DataInterfaceTestAbstract.php
:
- 96
+ 86
@@ -1055,7 +1510,7 @@
@@ -1088,7 +1543,7 @@
diff --git a/classes/chillerlan-QRCodeTest-Data-KanjiTest.html b/classes/chillerlan-QRCodeTest-Data-KanjiTest.html
index ca43be919..31d14bb48 100644
--- a/classes/chillerlan-QRCodeTest-Data-KanjiTest.html
+++ b/classes/chillerlan-QRCodeTest-Data-KanjiTest.html
@@ -140,6 +140,13 @@
-
+ $dataMode
+
+ : QRDataModeInterface
+
+
+
+ -
$FQN
: string
@@ -160,7 +167,21 @@
+ -
+ $MAX_LENGTH
+
+ : array<string|int, mixed>
+
+- ISO/IEC 18004:2000 Tables 7-11 - Number of symbol characters and input data capacity for versions 1 to 40
+
-
+ getMaxLengthForMode()
+
+ : int
+
+- the maximum character count for the given $mode and $eccLevel
+
+ -
kanjiProvider()
: Generator
@@ -174,6 +195,13 @@
+ -
+ maxLengthProvider()
+
+ : Generator
+
+- Generates test data for each data mode:
+
-
stringValidateProvider()
@@ -188,13 +216,6 @@
- Tests if a binary string is properly validated as false
- -
- testCodeLengthOverflowException()
-
- : void
-
-- Tests if an exception is thrown on data overflow
-
-
testDataModeInstance()
@@ -251,6 +272,20 @@
- Tests if an exception is thrown if the given string is empty
+ -
+ testMaxLength()
+
+ : void
+
+
+
+ -
+ testMaxLengthOverflowException()
+
+ : void
+
+- Tests if an exception is thrown on data overflow
+
-
testValidateSJIS()
@@ -297,6 +332,40 @@
-property
-protected
"
+>
+
+ $dataMode
+
+
+
+
+
+
+
+
+ protected
+ QRDataModeInterface
+ $dataMode
+
+
+
+
+
+
+
+
+
+
$FQN
@@ -314,7 +383,7 @@
protected
- string
+ static string
$FQN
= \chillerlan\QRCode\Data\Kanji::class
@@ -341,7 +410,7 @@
@@ -364,7 +433,7 @@
phpdocumentor-element
-property
-protected
- "
+ -static "
>
$testdata
@@ -382,7 +451,7 @@
protected
- string
+ static string
$testdata
= '漂う花の香り'
@@ -392,6 +461,95 @@
+
+
+
+ $MAX_LENGTH
+
+
+
+
+
+
+ ISO/IEC 18004:2000 Tables 7-11 - Number of symbol characters and input data capacity for versions 1 to 40
+
+
+ private
+ static array<string|int, mixed>
+ $MAX_LENGTH
+ = [
+ // v => [NUMERIC => [L, M, Q, H ], ALPHANUM => [L, M, Q, H], BINARY => [L, M, Q, H ], KANJI => [L, M, Q, H ]]
+ 1 => [[41, 34, 27, 17], [25, 20, 16, 10], [17, 14, 11, 7], [10, 8, 7, 4]],
+ 2 => [[77, 63, 48, 34], [47, 38, 29, 20], [32, 26, 20, 14], [20, 16, 12, 8]],
+ 3 => [[127, 101, 77, 58], [77, 61, 47, 35], [53, 42, 32, 24], [32, 26, 20, 15]],
+ 4 => [[187, 149, 111, 82], [114, 90, 67, 50], [78, 62, 46, 34], [48, 38, 28, 21]],
+ 5 => [[255, 202, 144, 106], [154, 122, 87, 64], [106, 84, 60, 44], [65, 52, 37, 27]],
+ 6 => [[322, 255, 178, 139], [195, 154, 108, 84], [134, 106, 74, 58], [82, 65, 45, 36]],
+ 7 => [[370, 293, 207, 154], [224, 178, 125, 93], [154, 122, 86, 64], [95, 75, 53, 39]],
+ 8 => [[461, 365, 259, 202], [279, 221, 157, 122], [192, 152, 108, 84], [118, 93, 66, 52]],
+ 9 => [[552, 432, 312, 235], [335, 262, 189, 143], [230, 180, 130, 98], [141, 111, 80, 60]],
+ 10 => [[652, 513, 364, 288], [395, 311, 221, 174], [271, 213, 151, 119], [167, 131, 93, 74]],
+ 11 => [[772, 604, 427, 331], [468, 366, 259, 200], [321, 251, 177, 137], [198, 155, 109, 85]],
+ 12 => [[883, 691, 489, 374], [535, 419, 296, 227], [367, 287, 203, 155], [226, 177, 125, 96]],
+ 13 => [[1022, 796, 580, 427], [619, 483, 352, 259], [425, 331, 241, 177], [262, 204, 149, 109]],
+ 14 => [[1101, 871, 621, 468], [667, 528, 376, 283], [458, 362, 258, 194], [282, 223, 159, 120]],
+ 15 => [[1250, 991, 703, 530], [758, 600, 426, 321], [520, 412, 292, 220], [320, 254, 180, 136]],
+ 16 => [[1408, 1082, 775, 602], [854, 656, 470, 365], [586, 450, 322, 250], [361, 277, 198, 154]],
+ 17 => [[1548, 1212, 876, 674], [938, 734, 531, 408], [644, 504, 364, 280], [397, 310, 224, 173]],
+ 18 => [[1725, 1346, 948, 746], [1046, 816, 574, 452], [718, 560, 394, 310], [442, 345, 243, 191]],
+ 19 => [[1903, 1500, 1063, 813], [1153, 909, 644, 493], [792, 624, 442, 338], [488, 384, 272, 208]],
+ 20 => [[2061, 1600, 1159, 919], [1249, 970, 702, 557], [858, 666, 482, 382], [528, 410, 297, 235]],
+ 21 => [[2232, 1708, 1224, 969], [1352, 1035, 742, 587], [929, 711, 509, 403], [572, 438, 314, 248]],
+ 22 => [[2409, 1872, 1358, 1056], [1460, 1134, 823, 640], [1003, 779, 565, 439], [618, 480, 348, 270]],
+ 23 => [[2620, 2059, 1468, 1108], [1588, 1248, 890, 672], [1091, 857, 611, 461], [672, 528, 376, 284]],
+ 24 => [[2812, 2188, 1588, 1228], [1704, 1326, 963, 744], [1171, 911, 661, 511], [721, 561, 407, 315]],
+ 25 => [[3057, 2395, 1718, 1286], [1853, 1451, 1041, 779], [1273, 997, 715, 535], [784, 614, 440, 330]],
+ 26 => [[3283, 2544, 1804, 1425], [1990, 1542, 1094, 864], [1367, 1059, 751, 593], [842, 652, 462, 365]],
+ 27 => [[3517, 2701, 1933, 1501], [2132, 1637, 1172, 910], [1465, 1125, 805, 625], [902, 692, 496, 385]],
+ 28 => [[3669, 2857, 2085, 1581], [2223, 1732, 1263, 958], [1528, 1190, 868, 658], [940, 732, 534, 405]],
+ 29 => [[3909, 3035, 2181, 1677], [2369, 1839, 1322, 1016], [1628, 1264, 908, 698], [1002, 778, 559, 430]],
+ 30 => [[4158, 3289, 2358, 1782], [2520, 1994, 1429, 1080], [1732, 1370, 982, 742], [1066, 843, 604, 457]],
+ 31 => [[4417, 3486, 2473, 1897], [2677, 2113, 1499, 1150], [1840, 1452, 1030, 790], [1132, 894, 634, 486]],
+ 32 => [[4686, 3693, 2670, 2022], [2840, 2238, 1618, 1226], [1952, 1538, 1112, 842], [1201, 947, 684, 518]],
+ 33 => [[4965, 3909, 2805, 2157], [3009, 2369, 1700, 1307], [2068, 1628, 1168, 898], [1273, 1002, 719, 553]],
+ 34 => [[5253, 4134, 2949, 2301], [3183, 2506, 1787, 1394], [2188, 1722, 1228, 958], [1347, 1060, 756, 590]],
+ 35 => [[5529, 4343, 3081, 2361], [3351, 2632, 1867, 1431], [2303, 1809, 1283, 983], [1417, 1113, 790, 605]],
+ 36 => [[5836, 4588, 3244, 2524], [3537, 2780, 1966, 1530], [2431, 1911, 1351, 1051], [1496, 1176, 832, 647]],
+ 37 => [[6153, 4775, 3417, 2625], [3729, 2894, 2071, 1591], [2563, 1989, 1423, 1093], [1577, 1224, 876, 673]],
+ 38 => [[6479, 5039, 3599, 2735], [3927, 3054, 2181, 1658], [2699, 2099, 1499, 1139], [1661, 1292, 923, 701]],
+ 39 => [[6743, 5313, 3791, 2927], [4087, 3220, 2298, 1774], [2809, 2213, 1579, 1219], [1729, 1362, 972, 750]],
+ 40 => [[7089, 5596, 3993, 3057], [4296, 3391, 2420, 1852], [2953, 2331, 1663, 1273], [1817, 1435, 1024, 784]],
+]
+
+
+
+
+
+
+ -
+ see
+
+ -
+ http://www.qrcode.com/en/about/version.html
+
+
+
+
+
@@ -405,6 +563,96 @@
-method
-public
-static "
+>
+
+
+
+ the maximum character count for the given $mode and $eccLevel
+
+
+ public
+ static getMaxLengthForMode(int $mode, Version $version, EccLevel $eccLevel) : int
+
+
+ Parameters
+
+ -
+ $mode
+ : int
+
+ -
+
+
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+
+
+
+
+
+ -
+ todo:
+
+ -
+
+
this methood is only used in unit tests (incl. MAX_LENGTH table)
+
+
+
+ -
+ throws
+
+ -
+ QRCodeException
+
+
+
+ -
+ codeCoverageIgnore
+
+ -
+
+
+
+
+
+ Return values
+ int
+ —
+
+
+
+
kanjiProvider()
@@ -446,7 +694,7 @@
@@ -458,23 +706,64 @@
+
+ Return values
+ array<string|int, array<string|int, int>>
+ —
+
+
+
+
+
+ maxLengthProvider()
+
+
+
+
+ Generates test data for each data mode:
+
+
+ public
+ static maxLengthProvider() : Generator
+
+
+- version
+- ECC level
+- a string that contains the maximum amount of characters for the given mode
+- a string that contains characters for the given mode and that exceeds the maximum length by one/two character(s)
+- the maximum allowed character length
+
+
+
+
+
-
- see
+ throws
-
- testInitMatrix()
-
+ Exception
+
Return values
- array<string|int, array<string|int, int>>
+ Generator
—
@@ -525,7 +814,7 @@
@@ -558,39 +847,6 @@
—
-
-
-
- testCodeLengthOverflowException()
-
-
-
-
- Tests if an exception is thrown on data overflow
-
-
- public
- testCodeLengthOverflowException() : void
-
-
-
-
-
- Return values
- void
- —
-
-
DataInterfaceTestAbstract.php
:
- 45
+ 54
@@ -638,7 +894,7 @@
@@ -697,7 +953,7 @@
@@ -705,11 +961,53 @@
public
- testGetMinimumVersion() : void
+ testGetMinimumVersion(Version $version, EccLevel $eccLevel, string $str) : void
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+
+
-
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
Return values
void
@@ -730,7 +1028,7 @@
@@ -763,7 +1061,7 @@
@@ -822,7 +1120,7 @@
@@ -855,7 +1153,7 @@
@@ -888,7 +1186,7 @@
@@ -907,6 +1205,163 @@
—
+
+
+
+ testMaxLength()
+
+
+
+
+
+
+ public
+ testMaxLength(Version $version, EccLevel $eccLevel, string $str) : void
+
+
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+
+
+
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ testMaxLengthOverflowException()
+
+
+
+
+ Tests if an exception is thrown on data overflow
+
+
+ public
+ testMaxLengthOverflowException(Version $version, EccLevel $eccLevel, string $str, string $str1) : void
+
+
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+ -
+ $str1
+ : string
+
+ -
+
+
+
+
+
+
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
DataInterfaceTestAbstract.php
:
- 96
+ 86
@@ -1055,7 +1510,7 @@
@@ -1088,7 +1543,7 @@
diff --git a/classes/chillerlan-QRCodeTest-Data-NumberTest.html b/classes/chillerlan-QRCodeTest-Data-NumberTest.html
index b2e3d3239..c76d4f9e2 100644
--- a/classes/chillerlan-QRCodeTest-Data-NumberTest.html
+++ b/classes/chillerlan-QRCodeTest-Data-NumberTest.html
@@ -140,6 +140,13 @@
-
+ $dataMode
+
+ : QRDataModeInterface
+
+
+
+ -
$FQN
: string
@@ -160,13 +167,34 @@
+ -
+ $MAX_LENGTH
+
+ : array<string|int, mixed>
+
+- ISO/IEC 18004:2000 Tables 7-11 - Number of symbol characters and input data capacity for versions 1 to 40
+
-
+ getMaxLengthForMode()
+
+ : int
+
+- the maximum character count for the given $mode and $eccLevel
+
+ -
maskPatternProvider()
: array<string|int, array<string|int, int>>
+ -
+ maxLengthProvider()
+
+ : Generator
+
+- Generates test data for each data mode:
+
-
stringValidateProvider()
@@ -181,13 +209,6 @@
- Tests if a binary string is properly validated as false
- -
- testCodeLengthOverflowException()
-
- : void
-
-- Tests if an exception is thrown on data overflow
-
-
testDataModeInstance()
@@ -244,6 +265,20 @@
- Tests if an exception is thrown if the given string is empty
+ -
+ testMaxLength()
+
+ : void
+
+
+
+ -
+ testMaxLengthOverflowException()
+
+ : void
+
+- Tests if an exception is thrown on data overflow
+
-
testValidateString()
@@ -283,6 +318,40 @@
-property
-protected
"
+>
+
+ $dataMode
+
+
+
+
+
+
+
+
+ protected
+ QRDataModeInterface
+ $dataMode
+
+
+
+
+
+
+
+
+
+
$FQN
@@ -300,7 +369,7 @@
protected
- string
+ static string
$FQN
= \chillerlan\QRCode\Data\Number::class
@@ -327,7 +396,7 @@
@@ -350,7 +419,7 @@
phpdocumentor-element
-property
-protected
- "
+ -static "
>
$testdata
@@ -368,7 +437,7 @@
protected
- string
+ static string
$testdata
= '0123456789'
@@ -378,6 +447,95 @@
+
+
+
+ $MAX_LENGTH
+
+
+
+
+
+
+ ISO/IEC 18004:2000 Tables 7-11 - Number of symbol characters and input data capacity for versions 1 to 40
+
+
+ private
+ static array<string|int, mixed>
+ $MAX_LENGTH
+ = [
+ // v => [NUMERIC => [L, M, Q, H ], ALPHANUM => [L, M, Q, H], BINARY => [L, M, Q, H ], KANJI => [L, M, Q, H ]]
+ 1 => [[41, 34, 27, 17], [25, 20, 16, 10], [17, 14, 11, 7], [10, 8, 7, 4]],
+ 2 => [[77, 63, 48, 34], [47, 38, 29, 20], [32, 26, 20, 14], [20, 16, 12, 8]],
+ 3 => [[127, 101, 77, 58], [77, 61, 47, 35], [53, 42, 32, 24], [32, 26, 20, 15]],
+ 4 => [[187, 149, 111, 82], [114, 90, 67, 50], [78, 62, 46, 34], [48, 38, 28, 21]],
+ 5 => [[255, 202, 144, 106], [154, 122, 87, 64], [106, 84, 60, 44], [65, 52, 37, 27]],
+ 6 => [[322, 255, 178, 139], [195, 154, 108, 84], [134, 106, 74, 58], [82, 65, 45, 36]],
+ 7 => [[370, 293, 207, 154], [224, 178, 125, 93], [154, 122, 86, 64], [95, 75, 53, 39]],
+ 8 => [[461, 365, 259, 202], [279, 221, 157, 122], [192, 152, 108, 84], [118, 93, 66, 52]],
+ 9 => [[552, 432, 312, 235], [335, 262, 189, 143], [230, 180, 130, 98], [141, 111, 80, 60]],
+ 10 => [[652, 513, 364, 288], [395, 311, 221, 174], [271, 213, 151, 119], [167, 131, 93, 74]],
+ 11 => [[772, 604, 427, 331], [468, 366, 259, 200], [321, 251, 177, 137], [198, 155, 109, 85]],
+ 12 => [[883, 691, 489, 374], [535, 419, 296, 227], [367, 287, 203, 155], [226, 177, 125, 96]],
+ 13 => [[1022, 796, 580, 427], [619, 483, 352, 259], [425, 331, 241, 177], [262, 204, 149, 109]],
+ 14 => [[1101, 871, 621, 468], [667, 528, 376, 283], [458, 362, 258, 194], [282, 223, 159, 120]],
+ 15 => [[1250, 991, 703, 530], [758, 600, 426, 321], [520, 412, 292, 220], [320, 254, 180, 136]],
+ 16 => [[1408, 1082, 775, 602], [854, 656, 470, 365], [586, 450, 322, 250], [361, 277, 198, 154]],
+ 17 => [[1548, 1212, 876, 674], [938, 734, 531, 408], [644, 504, 364, 280], [397, 310, 224, 173]],
+ 18 => [[1725, 1346, 948, 746], [1046, 816, 574, 452], [718, 560, 394, 310], [442, 345, 243, 191]],
+ 19 => [[1903, 1500, 1063, 813], [1153, 909, 644, 493], [792, 624, 442, 338], [488, 384, 272, 208]],
+ 20 => [[2061, 1600, 1159, 919], [1249, 970, 702, 557], [858, 666, 482, 382], [528, 410, 297, 235]],
+ 21 => [[2232, 1708, 1224, 969], [1352, 1035, 742, 587], [929, 711, 509, 403], [572, 438, 314, 248]],
+ 22 => [[2409, 1872, 1358, 1056], [1460, 1134, 823, 640], [1003, 779, 565, 439], [618, 480, 348, 270]],
+ 23 => [[2620, 2059, 1468, 1108], [1588, 1248, 890, 672], [1091, 857, 611, 461], [672, 528, 376, 284]],
+ 24 => [[2812, 2188, 1588, 1228], [1704, 1326, 963, 744], [1171, 911, 661, 511], [721, 561, 407, 315]],
+ 25 => [[3057, 2395, 1718, 1286], [1853, 1451, 1041, 779], [1273, 997, 715, 535], [784, 614, 440, 330]],
+ 26 => [[3283, 2544, 1804, 1425], [1990, 1542, 1094, 864], [1367, 1059, 751, 593], [842, 652, 462, 365]],
+ 27 => [[3517, 2701, 1933, 1501], [2132, 1637, 1172, 910], [1465, 1125, 805, 625], [902, 692, 496, 385]],
+ 28 => [[3669, 2857, 2085, 1581], [2223, 1732, 1263, 958], [1528, 1190, 868, 658], [940, 732, 534, 405]],
+ 29 => [[3909, 3035, 2181, 1677], [2369, 1839, 1322, 1016], [1628, 1264, 908, 698], [1002, 778, 559, 430]],
+ 30 => [[4158, 3289, 2358, 1782], [2520, 1994, 1429, 1080], [1732, 1370, 982, 742], [1066, 843, 604, 457]],
+ 31 => [[4417, 3486, 2473, 1897], [2677, 2113, 1499, 1150], [1840, 1452, 1030, 790], [1132, 894, 634, 486]],
+ 32 => [[4686, 3693, 2670, 2022], [2840, 2238, 1618, 1226], [1952, 1538, 1112, 842], [1201, 947, 684, 518]],
+ 33 => [[4965, 3909, 2805, 2157], [3009, 2369, 1700, 1307], [2068, 1628, 1168, 898], [1273, 1002, 719, 553]],
+ 34 => [[5253, 4134, 2949, 2301], [3183, 2506, 1787, 1394], [2188, 1722, 1228, 958], [1347, 1060, 756, 590]],
+ 35 => [[5529, 4343, 3081, 2361], [3351, 2632, 1867, 1431], [2303, 1809, 1283, 983], [1417, 1113, 790, 605]],
+ 36 => [[5836, 4588, 3244, 2524], [3537, 2780, 1966, 1530], [2431, 1911, 1351, 1051], [1496, 1176, 832, 647]],
+ 37 => [[6153, 4775, 3417, 2625], [3729, 2894, 2071, 1591], [2563, 1989, 1423, 1093], [1577, 1224, 876, 673]],
+ 38 => [[6479, 5039, 3599, 2735], [3927, 3054, 2181, 1658], [2699, 2099, 1499, 1139], [1661, 1292, 923, 701]],
+ 39 => [[6743, 5313, 3791, 2927], [4087, 3220, 2298, 1774], [2809, 2213, 1579, 1219], [1729, 1362, 972, 750]],
+ 40 => [[7089, 5596, 3993, 3057], [4296, 3391, 2420, 1852], [2953, 2331, 1663, 1273], [1817, 1435, 1024, 784]],
+]
+
+
+
+
+
+
+ -
+ see
+
+ -
+ http://www.qrcode.com/en/about/version.html
+
+
+
+
+
@@ -391,6 +549,96 @@
-method
-public
-static "
+>
+
+
+
+ the maximum character count for the given $mode and $eccLevel
+
+
+ public
+ static getMaxLengthForMode(int $mode, Version $version, EccLevel $eccLevel) : int
+
+
+ Parameters
+
+ -
+ $mode
+ : int
+
+ -
+
+
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+
+
+
+
+
+ -
+ todo:
+
+ -
+
+
this methood is only used in unit tests (incl. MAX_LENGTH table)
+
+
+
+ -
+ throws
+
+ -
+ QRCodeException
+
+
+
+ -
+ codeCoverageIgnore
+
+ -
+
+
+
+
+
+ Return values
+ int
+ —
+
+
+
+
maskPatternProvider()
@@ -399,7 +647,7 @@
@@ -411,23 +659,64 @@
+
+ Return values
+ array<string|int, array<string|int, int>>
+ —
+
+
+
+
+
+ maxLengthProvider()
+
+
+
+
+ Generates test data for each data mode:
+
+
+ public
+ static maxLengthProvider() : Generator
+
+
+- version
+- ECC level
+- a string that contains the maximum amount of characters for the given mode
+- a string that contains characters for the given mode and that exceeds the maximum length by one/two character(s)
+- the maximum allowed character length
+
+
+
+
+
-
- see
+ throws
-
- testInitMatrix()
-
+ Exception
+
Return values
- array<string|int, array<string|int, int>>
+ Generator
—
@@ -478,7 +767,7 @@
@@ -511,39 +800,6 @@
—
-
-
-
- testCodeLengthOverflowException()
-
-
-
-
- Tests if an exception is thrown on data overflow
-
-
- public
- testCodeLengthOverflowException() : void
-
-
-
-
-
- Return values
- void
- —
-
-
DataInterfaceTestAbstract.php
:
- 45
+ 54
@@ -591,7 +847,7 @@
@@ -650,7 +906,7 @@
@@ -658,11 +914,53 @@
public
- testGetMinimumVersion() : void
+ testGetMinimumVersion(Version $version, EccLevel $eccLevel, string $str) : void
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+
+
-
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
Return values
void
@@ -683,7 +981,7 @@
@@ -716,7 +1014,7 @@
@@ -775,7 +1073,7 @@
@@ -808,7 +1106,7 @@
@@ -841,7 +1139,7 @@
@@ -860,6 +1158,163 @@
—
+
+
+
+ testMaxLength()
+
+
+
+
+
+
+ public
+ testMaxLength(Version $version, EccLevel $eccLevel, string $str) : void
+
+
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+
+
+
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
+
+
+
+ testMaxLengthOverflowException()
+
+
+
+
+ Tests if an exception is thrown on data overflow
+
+
+ public
+ testMaxLengthOverflowException(Version $version, EccLevel $eccLevel, string $str, string $str1) : void
+
+
+ Parameters
+
+ -
+ $version
+ : Version
+
+ -
+
+
+
+ -
+ $eccLevel
+ : EccLevel
+
+ -
+
+
+
+ -
+ $str
+ : string
+
+ -
+
+
+
+ -
+ $str1
+ : string
+
+ -
+
+
+
+
+
+
+
+
+ -
+ dataProvider
+
+ -
+
+
+
+
+
+
+ Return values
+ void
+ —
+
+
DataInterfaceTestAbstract.php
:
- 96
+ 86
@@ -941,7 +1396,7 @@
@@ -974,7 +1429,7 @@
diff --git a/classes/chillerlan-QRCodeTest-QRCodeReaderGDTest.html b/classes/chillerlan-QRCodeTest-QRCodeReaderGDTest.html
index 8d2899877..009732f63 100644
--- a/classes/chillerlan-QRCodeTest-QRCodeReaderGDTest.html
+++ b/classes/chillerlan-QRCodeTest-QRCodeReaderGDTest.html
@@ -176,7 +176,7 @@
getMaxLengthForMode()
- : int|null
+ : int