TextMessage::__toString()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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