| Total Complexity | 3 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | final class FormatInformation{ |
||
| 21 | |||
| 22 | public const FORMAT_INFO_MASK_QR = 0x5412; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * See ISO 18004:2006, Annex C, Table C.1 |
||
| 26 | * |
||
| 27 | * [data bits, sequence after masking] |
||
| 28 | */ |
||
| 29 | public const DECODE_LOOKUP = [ |
||
| 30 | [0x00, 0x5412], |
||
| 31 | [0x01, 0x5125], |
||
| 32 | [0x02, 0x5E7C], |
||
| 33 | [0x03, 0x5B4B], |
||
| 34 | [0x04, 0x45F9], |
||
| 35 | [0x05, 0x40CE], |
||
| 36 | [0x06, 0x4F97], |
||
| 37 | [0x07, 0x4AA0], |
||
| 38 | [0x08, 0x77C4], |
||
| 39 | [0x09, 0x72F3], |
||
| 40 | [0x0A, 0x7DAA], |
||
| 41 | [0x0B, 0x789D], |
||
| 42 | [0x0C, 0x662F], |
||
| 43 | [0x0D, 0x6318], |
||
| 44 | [0x0E, 0x6C41], |
||
| 45 | [0x0F, 0x6976], |
||
| 46 | [0x10, 0x1689], |
||
| 47 | [0x11, 0x13BE], |
||
| 48 | [0x12, 0x1CE7], |
||
| 49 | [0x13, 0x19D0], |
||
| 50 | [0x14, 0x0762], |
||
| 51 | [0x15, 0x0255], |
||
| 52 | [0x16, 0x0D0C], |
||
| 53 | [0x17, 0x083B], |
||
| 54 | [0x18, 0x355F], |
||
| 55 | [0x19, 0x3068], |
||
| 56 | [0x1A, 0x3F31], |
||
| 57 | [0x1B, 0x3A06], |
||
| 58 | [0x1C, 0x24B4], |
||
| 59 | [0x1D, 0x2183], |
||
| 60 | [0x1E, 0x2EDA], |
||
| 61 | [0x1F, 0x2BED], |
||
| 62 | ]; |
||
| 63 | |||
| 64 | /** |
||
| 65 | * The current ECC level value |
||
| 66 | * |
||
| 67 | * L: 0b01 |
||
| 68 | * M: 0b00 |
||
| 69 | * Q: 0b11 |
||
| 70 | * H: 0b10 |
||
| 71 | */ |
||
| 72 | private int $errorCorrectionLevel; |
||
| 73 | |||
| 74 | /** |
||
| 75 | * The current mask pattern (0-7) |
||
| 76 | */ |
||
| 77 | private int $maskPattern; |
||
| 78 | |||
| 79 | /** |
||
| 80 | * Receives the format information from a parsed QR Code, detects ECC level and mask pattern |
||
| 81 | */ |
||
| 82 | public function __construct(int $formatInfo){ |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * Returns and EccLevel instance ith the detected ECC level set |
||
| 89 | */ |
||
| 90 | public function getErrorCorrectionLevel():EccLevel{ |
||
| 92 | } |
||
| 93 | |||
| 94 | /** |
||
| 95 | * Returns a MaskPattern instance with the detected mask pattern set |
||
| 96 | */ |
||
| 97 | public function getMaskPattern():MaskPattern{ |
||
| 103 |