UploadFile   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 43
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getParams() 0 3 1
A getPath() 0 3 1
A getData() 0 3 1
A parseResult() 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\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