Passed
Push — main ( b62539...4e03cd )
by smiley
01:53
created

QRDataModeAbstract::getDataMode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
/**
3
 * Class QRDataModeAbstract
4
 *
5
 * @created      19.11.2020
6
 * @author       smiley <[email protected]>
7
 * @copyright    2020 smiley
8
 * @license      MIT
9
 */
10
11
namespace chillerlan\QRCode\Data;
12
13
/**
14
 */
15
abstract class QRDataModeAbstract implements QRDataModeInterface{
16
17
	/**
18
	 * the current data mode: Num, Alphanum, Kanji, Byte
19
	 */
20
	protected static int $datamode;
21
22
	/**
23
	 * The data to write
24
	 */
25
	protected string $data;
26
27
	/**
28
	 * QRDataModeAbstract constructor.
29
	 */
30
	public function __construct(string $data){
31
		$this->data = $data;
32
	}
33
34
	/**
35
	 * returns the character count of the $data string
36
	 */
37
	protected function getCharCount():int{
38
		return strlen($this->data);
39
	}
40
41
	/**
42
	 * @inheritDoc
43
	 */
44
	public function getDataMode():int{
45
		return $this::$datamode;
46
	}
47
48
}
49