Files
php-qrcode/src/Data/Byte.php
T
2015-12-04 04:34:00 +01:00

43 lines
684 B
PHP

<?php
/**
* Class Byte
*
* @filesource Byte.php
* @created 25.11.2015
* @package codemasher\QRCode\Data
* @author Smiley <smiley@chillerlan.net>
* @copyright 2015 Smiley
* @license MIT
*/
namespace codemasher\QRCode\Data;
use codemasher\QRCode\BitBuffer;
use codemasher\QRCode\QRConst;
/**
*
*/
class Byte extends QRDataBase implements QRDataInterface{
/**
* @var
*/
public $mode = QRConst::MODE_BYTE;
/**
* @var array
*/
protected $lengthBits = [8, 16, 16];
/**
* @param $buffer
*/
public function write(BitBuffer &$buffer){
for($i = 0; $i < $this->dataLength; $i++){
$buffer->put(ord($this->data[$i]), 8);
}
}
}