Completed
Push — master ( ef42ef...514bca )
by smiley
06:10
created

Byte   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 2
1
<?php
2
/**
3
 * Class Byte
4
 *
5
 * @filesource   Byte.php
6
 * @created      25.11.2015
7
 * @package      chillerlan\QRCode\Data
8
 * @author       Smiley <[email protected]>
9
 * @copyright    2015 Smiley
10
 * @license      MIT
11
 */
12
13
namespace chillerlan\QRCode\Data;
14
15
use chillerlan\QRCode\QRCode;
16
17
use function ord;
18
19
/**
20
 * Byte mode, ISO-8859-1 or UTF-8
21
 */
22
class Byte extends QRDataAbstract{
23
24
	protected int $datamode = QRCode::DATA_BYTE;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
25
26
	protected array $lengthBits = [8, 16, 16];
27
28
	/**
29
	 * @inheritdoc
30
	 */
31
	protected function write(string $data):void{
32
		$i = 0;
33
34
		while($i < $this->strlen){
35
			$this->bitBuffer->put(ord($data[$i]), 8);
36
			$i++;
37
		}
38
39
	}
40
41
}
42