UploadFile::getData()   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\Commands;
9
10
use Threema\MsgApi\Commands\MultiPartCommandInterface;
11
use Threema\MsgApi\Commands\Results\UploadFileResult;
12
13
class UploadFile implements MultiPartCommandInterface {
14
	/**
15
	 * @var string
16
	 */
17
	private $encryptedFileData;
18
19
	/**
20
	 * @param string $encryptedFileData (binary) the encrypted file data
21
	 */
22
	public function __construct($encryptedFileData) {
23
		$this->encryptedFileData = $encryptedFileData;
24
	}
25
26
	/**
27
	 * @return array
28
	 */
29
	public function getParams() {
30
		return array();
31
	}
32
33
	/**
34
	 * @return string
35
	 */
36
	public function getPath() {
37
		return 'upload_blob';
38
	}
39
40
	/**
41
	 * @return string
42
	 */
43
	public function getData() {
44
		return $this->encryptedFileData;
45
	}
46
47
	/**
48
	 * @param int $httpCode
49
	 * @param object $res
50
	 * @return UploadFileResult
51
	 */
52
	public function parseResult($httpCode, $res){
53
		return new UploadFileResult($httpCode, $res);
54
	}
55
}
56