DownloadFile   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getParams() 0 3 1
A getPath() 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\CommandInterface;
11
use Threema\MsgApi\Commands\Results\DownloadFileResult;
12
use Threema\MsgApi\Commands\Results\UploadFileResult;
13
14
class DownloadFile implements CommandInterface {
15
	/**
16
	 * @var string
17
	 */
18
	private $blobId;
19
20
	/**
21
	 * @param string $blobId
22
	 */
23
	public function __construct($blobId) {
24
		$this->blobId = $blobId;
25
	}
26
27
	/**
28
	 * @return array
29
	 */
30
	public function getParams() {
31
		return array();
32
	}
33
34
	/**
35
	 * @return string
36
	 */
37
	public function getPath() {
38
		return 'blobs/'.$this->blobId;
39
	}
40
41
	/**
42
	 * @param int $httpCode
43
	 * @param object $res
44
	 * @return UploadFileResult
45
	 */
46
	public function parseResult($httpCode, $res){
47
		return new DownloadFileResult($httpCode, $res);
48
	}
49
}
50