FileAnalysisResult::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
/**
3
 * @author Threema GmbH
4
 * @copyright Copyright (c) 2015-2016 Threema GmbH
5
 */
6
7
8
namespace Threema\MsgApi\Tools;
9
10
class FileAnalysisResult {
11
	/**
12
	 * @var string
13
	 */
14
	private $mimeType;
15
16
	/**
17
	 * @var int
18
	 */
19
	private $size;
20
21
	/**
22
	 * @var string
23
	 */
24
	private $path;
25
26
	/**
27
	 * @param string $mimeType
28
	 * @param int $size
29
	 * @param string $path
30
	 */
31
	public function __construct($mimeType, $size, $path) {
32
		$this->mimeType = $mimeType;
33
		$this->size = $size;
34
		$this->path = realpath($path);
35
	}
36
37
	/**
38
	 * @return string
39
	 */
40
	public function getMimeType() {
41
		return $this->mimeType;
42
	}
43
44
	/**
45
	 * @return int
46
	 */
47
	public function getSize() {
48
		return $this->size;
49
	}
50
51
	/**
52
	 * @return string
53
	 */
54
	public function getPath() {
55
		return $this->path;
56
	}
57
58
	/**
59
	 * @return string
60
	 */
61
	public function getFileName() {
62
		return basename($this->path);
63
	}
64
}
65