Completed
Push — master ( eda387...29bdeb )
by Robin
04:14
created

FileInfo::isSystem()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Copyright (c) 2014 Robin Appelman <[email protected]>
4
 * This file is licensed under the Licensed under the MIT license:
5
 * http://opensource.org/licenses/MIT
6
 */
7
8
namespace Icewind\SMB\Wrapped;
9
10
use Icewind\SMB\IFileInfo;
11
12
class FileInfo implements IFileInfo {
13
	/**
14
	 * @var string
15
	 */
16
	protected $path;
17
18
	/**
19
	 * @var string
20
	 */
21
	protected $name;
22
23
	/**
24
	 * @var int
25
	 */
26
	protected $size;
27
28
	/**
29
	 * @var int
30
	 */
31
	protected $time;
32
33
	/**
34
	 * @var int
35
	 */
36
	protected $mode;
37
38
	/**
39
	 * @param string $path
40
	 * @param string $name
41
	 * @param int $size
42
	 * @param int $time
43
	 * @param int $mode
44
	 */
45 100
	public function __construct($path, $name, $size, $time, $mode) {
46 100
		$this->path = $path;
47 100
		$this->name = $name;
48 100
		$this->size = $size;
49 100
		$this->time = $time;
50 100
		$this->mode = $mode;
51 100
	}
52
53
	/**
54
	 * @return string
55
	 */
56 95
	public function getPath() {
57 95
		return $this->path;
58
	}
59
60
	/**
61
	 * @return string
62
	 */
63 49
	public function getName() {
64 49
		return $this->name;
65
	}
66
67
	/**
68
	 * @return int
69
	 */
70 29
	public function getSize() {
71 29
		return $this->size;
72
	}
73
74
	/**
75
	 * @return int
76
	 */
77 1
	public function getMTime() {
78 1
		return $this->time;
79
	}
80
81
	/**
82
	 * @return bool
83
	 */
84 95
	public function isDirectory() {
85 95
		return (bool)($this->mode & IFileInfo::MODE_DIRECTORY);
86
	}
87
88
	/**
89
	 * @return bool
90
	 */
91 9
	public function isReadOnly() {
92 9
		return (bool)($this->mode & IFileInfo::MODE_READONLY);
93
	}
94
95
	/**
96
	 * @return bool
97
	 */
98 13
	public function isHidden() {
99 13
		return (bool)($this->mode & IFileInfo::MODE_HIDDEN);
100
	}
101
102
	/**
103
	 * @return bool
104
	 */
105 8
	public function isSystem() {
106 8
		return (bool)($this->mode & IFileInfo::MODE_SYSTEM);
107
	}
108
109
	/**
110
	 * @return bool
111
	 */
112 8
	public function isArchived() {
113 8
		return (bool)($this->mode & IFileInfo::MODE_ARCHIVE);
114
	}
115
}
116