1 | <?php |
||
21 | class QRCode{ |
||
22 | |||
23 | /** |
||
24 | * API constants |
||
25 | */ |
||
26 | const OUTPUT_STRING_TEXT = 'txt'; |
||
27 | const OUTPUT_STRING_JSON = 'json'; |
||
28 | |||
29 | const OUTPUT_MARKUP_HTML = 'html'; |
||
30 | const OUTPUT_MARKUP_SVG = 'svg'; |
||
31 | # const OUTPUT_MARKUP_XML = 'xml'; // anyone? |
||
32 | |||
33 | const OUTPUT_IMAGE_PNG = 'png'; |
||
34 | const OUTPUT_IMAGE_JPG = 'jpg'; |
||
35 | const OUTPUT_IMAGE_GIF = 'gif'; |
||
36 | |||
37 | const ERROR_CORRECT_LEVEL_L = 1; // 7%. |
||
38 | const ERROR_CORRECT_LEVEL_M = 0; // 15%. |
||
39 | const ERROR_CORRECT_LEVEL_Q = 3; // 25%. |
||
40 | const ERROR_CORRECT_LEVEL_H = 2; // 30%. |
||
41 | |||
42 | // max bits @ ec level L:07 M:15 Q:25 H:30 % |
||
43 | const TYPE_01 = 1; // 152 128 104 72 |
||
44 | const TYPE_02 = 2; // 272 224 176 128 |
||
45 | const TYPE_03 = 3; // 440 352 272 208 |
||
46 | const TYPE_04 = 4; // 640 512 384 288 |
||
47 | const TYPE_05 = 5; // 864 688 496 368 |
||
48 | const TYPE_06 = 6; // 1088 864 608 480 |
||
49 | const TYPE_07 = 7; // 1248 992 704 528 |
||
50 | const TYPE_08 = 8; // 1552 1232 880 688 |
||
51 | const TYPE_09 = 9; // 1856 1456 1056 800 |
||
52 | const TYPE_10 = 10; // 2192 1728 1232 976 |
||
53 | |||
54 | /** |
||
55 | * @var int |
||
56 | */ |
||
57 | protected $typeNumber; |
||
58 | |||
59 | /** |
||
60 | * @var int |
||
61 | */ |
||
62 | protected $errorCorrectLevel; |
||
63 | |||
64 | /** |
||
65 | * @var \chillerlan\QRCode\Output\QROutputInterface |
||
66 | */ |
||
67 | protected $qrOutputInterface; |
||
68 | |||
69 | /** |
||
70 | * @var string |
||
71 | */ |
||
72 | protected $data; |
||
73 | |||
74 | /** |
||
75 | * QRCode constructor. |
||
76 | * |
||
77 | * @param string $data |
||
78 | * @param \chillerlan\QRCode\Output\QROutputInterface $output |
||
79 | * @param \chillerlan\QRCode\QROptions|null $options |
||
80 | */ |
||
81 | public function __construct($data, QROutputInterface $output, QROptions $options = null){ |
||
86 | |||
87 | /** |
||
88 | * @param string $data |
||
89 | * @param \chillerlan\QRCode\QROptions|null $options |
||
90 | * |
||
91 | * @return \chillerlan\QRCode\QRCode |
||
92 | * @throws \chillerlan\QRCode\QRCodeException |
||
93 | */ |
||
94 | public function setData(string $data, QROptions $options = null):QRCode { |
||
114 | |||
115 | /** |
||
116 | * @return mixed |
||
117 | */ |
||
118 | public function output(){ |
||
123 | |||
124 | /** |
||
125 | * @return array |
||
126 | */ |
||
127 | public function getRawData():array { |
||
130 | |||
131 | } |
||
132 |