TextMessage   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 38
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getText() 0 3 1
A __toString() 0 3 1
A getTypeCode() 0 3 1
1
<?php
2
/**
3
 * @author Threema GmbH
4
 * @copyright Copyright (c) 2015-2016 Threema GmbH
5
 */
6
7
8
namespace Threema\MsgApi\Messages;
9
10
class TextMessage extends ThreemaMessage {
11
	const TYPE_CODE = 0x01;
12
13
	/**
14
	 * @var string
15
	 */
16
	private $text;
17
18
	/**
19
	 * @param string $text
20
	 */
21
	public function __construct($text) {
22
		$this->text = $text;
23
	}
24
25
	/**
26
	 * @return string text
27
	 */
28
	public function getText() {
29
		return $this->text;
30
	}
31
32
	/**
33
	 * @return string
34
	 */
35
	public function __toString() {
36
		return 'text message';
37
	}
38
39
	/**
40
	 * Get the message type code of this message.
41
	 *
42
	 * @return int message type code
43
	 */
44
	public function getTypeCode() {
45
		return self::TYPE_CODE;
46
	}
47
}
48