| 1285 | //########################################################################## |
| 1286 | |
| 1287 | class QRinput { |
| 1288 | |
| 1289 | public $items; |
| 1290 | |
| 1291 | private $version; |
| 1292 | private $level; |
| 1293 | |
| 1294 | //---------------------------------------------------------------------- |
| 1295 | public function __construct($version = 0, $level = QR_ECLEVEL_L) |
| 1296 | { |
| 1297 | if ($version < 0 || $version > QRSPEC_VERSION_MAX || $level > QR_ECLEVEL_H) { |
| 1298 | throw new Exception('Invalid version no'); |
| 1299 | return NULL; |
| 1300 | } |
| 1301 | |
| 1302 | $this->version = $version; |
| 1303 | $this->level = $level; |
| 1304 | } |
| 1305 | |
| 1306 | //---------------------------------------------------------------------- |
| 1307 | public function getVersion() |
| 1308 | { |
| 1309 | return $this->version; |
| 1310 | } |
| 1311 | |
| 1312 | //---------------------------------------------------------------------- |
| 1313 | public function setVersion($version) |
| 1314 | { |
| 1315 | if($version < 0 || $version > QRSPEC_VERSION_MAX) { |
| 1316 | throw new Exception('Invalid version no'); |
| 1317 | return -1; |
| 1318 | } |
| 1319 | |
| 1320 | $this->version = $version; |
| 1321 | |
| 1322 | return 0; |
| 1323 | } |
| 1324 | |
| 1325 | //---------------------------------------------------------------------- |
| 1326 | public function getErrorCorrectionLevel() |
| 1327 | { |
| 1328 | return $this->level; |
| 1329 | } |
| 1330 | |
| 1331 | //---------------------------------------------------------------------- |
| 1332 | public function setErrorCorrectionLevel($level) |
| 1333 | { |
| 1334 | if($level > QR_ECLEVEL_H) { |
| 1335 | throw new Exception('Invalid ECLEVEL'); |
| 1336 | return -1; |
| 1337 | } |
| 1338 | |
| 1339 | $this->level = $level; |
| 1340 | |
| 1341 | return 0; |
| 1342 | } |
| 1343 | |
| 1344 | //---------------------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected