Completed
Push — master ( 228057...4623d7 )
by Robin
05:13
created

FileInfo::isArchived()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
	public function __construct($path, $name, $size, $time, $mode) {
46
		$this->path = $path;
47
		$this->name = $name;
48
		$this->size = $size;
49
		$this->time = $time;
50
		$this->mode = $mode;
51
	}
52
53
	/**
54
	 * @return string
55
	 */
56
	public function getPath() {
57
		return $this->path;
58
	}
59
60
	/**
61
	 * @return string
62
	 */
63
	public function getName() {
64
		return $this->name;
65
	}
66
67
	/**
68
	 * @return int
69
	 */
70
	public function getSize() {
71
		return $this->size;
72
	}
73
74
	/**
75
	 * @return int
76
	 */
77
	public function getMTime() {
78
		return $this->time;
79
	}
80
81
	/**
82
	 * @return bool
83
	 */
84
	public function isDirectory() {
85
		return (bool)($this->mode & IFileInfo::MODE_DIRECTORY);
86
	}
87
88
	/**
89
	 * @return bool
90
	 */
91
	public function isReadOnly() {
92
		return (bool)($this->mode & IFileInfo::MODE_READONLY);
93
	}
94
95
	/**
96
	 * @return bool
97
	 */
98
	public function isHidden() {
99
		return (bool)($this->mode & IFileInfo::MODE_HIDDEN);
100
	}
101
102
	/**
103
	 * @return bool
104
	 */
105
	public function isSystem() {
106
		return (bool)($this->mode & IFileInfo::MODE_SYSTEM);
107
	}
108
109
	/**
110
	 * @return bool
111
	 */
112
	public function isArchived() {
113
		return (bool)($this->mode & IFileInfo::MODE_ARCHIVE);
114
	}
115
}
116