FileMessage::__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 FileMessage extends ThreemaMessage {
11
	const TYPE_CODE = 0x17;
12
13
	/**
14
	 * @var string
15
	 */
16
	private $blobId;
17
18
	/**
19
	 * @var string
20
	 */
21
	private $thumbnailBlobId;
22
23
	/**
24
	 * @var string
25
	 */
26
	private $encryptionKey;
27
28
	/**
29
	 * @var string
30
	 */
31
	private $mimeType;
32
33
	/**
34
	 * @var string
35
	 */
36
	private $filename;
37
38
	/**
39
	 * @var int
40
	 */
41
	private $size;
42
43
	/**
44
	 * @param string $blobId
45
	 * @param string $thumbnailBlobId
46
	 * @param string $encryptionKey
47
	 * @param string $mimeType
48
	 * @param string $filename
49
	 * @param int $size
50
	 */
51
	public function __construct($blobId, $thumbnailBlobId, $encryptionKey, $mimeType, $filename, $size) {
52
		$this->blobId = $blobId;
53
		$this->thumbnailBlobId = $thumbnailBlobId;
54
		$this->encryptionKey = $encryptionKey;
55
		$this->mimeType = $mimeType;
56
		$this->filename = $filename;
57
		$this->size = $size;
58
	}
59
60
	/**
61
	 * @return string
62
	 */
63
	public function getBlobId() {
64
		return $this->blobId;
65
	}
66
67
	/**
68
	 * @return string
69
	 */
70
	public function getEncryptionKey() {
71
		return $this->encryptionKey;
72
	}
73
74
	/**
75
	 * @return string
76
	 */
77
	public function getFilename() {
78
		return $this->filename;
79
	}
80
81
	/**
82
	 * @return string
83
	 */
84
	public function getMimeType() {
85
		return $this->mimeType;
86
	}
87
88
	/**
89
	 * @return int
90
	 */
91
	public function getSize() {
92
		return $this->size;
93
	}
94
95
	/**
96
	 * @return string
97
	 */
98
	public function getThumbnailBlobId() {
99
		return $this->thumbnailBlobId;
100
	}
101
102
	/**
103
	 * @return string
104
	 */
105
	public function __toString() {
106
		return 'file message';
107
	}
108
109
	/**
110
	 * Get the message type code of this message.
111
	 *
112
	 * @return int message type code
113
	 */
114
	public final function getTypeCode() {
115
		return self::TYPE_CODE;
116
	}
117
}
118