1 | <?php |
||
10 | class IndexObject implements \ArrayAccess |
||
11 | { |
||
12 | public const TYPE_DIR = 1; |
||
13 | public const TYPE_FILE = 2; |
||
14 | public const TYPE_LINK = 3; |
||
15 | |||
16 | public const CMP_IGNORE_BLOBID = 1; |
||
17 | public const CMP_IGNORE_INODE = 2; |
||
18 | public const CMP_IGNORE_CTIME = 4; |
||
19 | |||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $relativePath; |
||
25 | |||
26 | /** |
||
27 | * @var int |
||
28 | */ |
||
29 | protected $type; |
||
30 | |||
31 | /** |
||
32 | * @var float |
||
33 | */ |
||
34 | protected $mtime; |
||
35 | |||
36 | /** |
||
37 | * @var float |
||
38 | */ |
||
39 | protected $ctime; |
||
40 | |||
41 | /** |
||
42 | * mode & 0777 |
||
43 | * |
||
44 | * @var int |
||
45 | */ |
||
46 | protected $permissions; |
||
47 | |||
48 | /** |
||
49 | * @var int |
||
50 | */ |
||
51 | protected $size; |
||
52 | |||
53 | /** |
||
54 | * @var int |
||
55 | */ |
||
56 | protected $inode; |
||
57 | |||
58 | /** |
||
59 | * @var string |
||
60 | */ |
||
61 | protected $linkTarget; |
||
62 | |||
63 | /** |
||
64 | * Content hashes for file index objects. |
||
65 | * |
||
66 | * @var HashContainer |
||
67 | */ |
||
68 | protected $hashes; |
||
69 | |||
70 | /** |
||
71 | * @var string |
||
72 | */ |
||
73 | protected $blobId; |
||
74 | |||
75 | public function __construct(string $relativePath, int $type, float $mtime, float $ctime, int $permissions, ?int $size, ?int $inode, ?string $linkTarget, ?string $blobId, ?HashContainer $hashContainer) |
||
94 | |||
95 | public function getRelativePath(): string |
||
99 | |||
100 | public function getBasename(): string |
||
106 | |||
107 | public function getType(): int |
||
111 | |||
112 | public function getTypeName(): string |
||
116 | |||
117 | public function isDirectory(): bool |
||
121 | |||
122 | public function isFile(): bool |
||
126 | |||
127 | public function isLink(): bool |
||
131 | |||
132 | public function getMtime(): float |
||
136 | |||
137 | public function getCtime(): float |
||
141 | |||
142 | public function getPermissions(): int |
||
146 | |||
147 | public function getPermissionsString(): string |
||
151 | |||
152 | public function getSize(): ?int |
||
156 | |||
157 | public function getInode(): ?int |
||
161 | |||
162 | public function getLinkTarget(): ?string |
||
166 | |||
167 | public function getHashes(): ?HashContainer |
||
171 | |||
172 | public function getBlobId(): ?string |
||
176 | |||
177 | public function setBlobId(string $blobId): IndexObject |
||
185 | |||
186 | /** |
||
187 | * Equality check with all attributes. |
||
188 | * |
||
189 | * @param IndexObject $other |
||
190 | * @param int $options |
||
191 | * @return bool |
||
192 | */ |
||
193 | public function equals(?IndexObject $other, int $options = 0): bool |
||
218 | |||
219 | /** |
||
220 | * @inheritdoc |
||
221 | */ |
||
222 | public function offsetExists($offset) |
||
226 | |||
227 | /** |
||
228 | * @inheritdoc |
||
229 | */ |
||
230 | public function offsetGet($offset) |
||
236 | |||
237 | /** |
||
238 | * @inheritdoc |
||
239 | */ |
||
240 | public function offsetSet($offset, $value) |
||
244 | |||
245 | /** |
||
246 | * @inheritdoc |
||
247 | */ |
||
248 | public function offsetUnset($offset) |
||
252 | |||
253 | public function __clone() |
||
260 | |||
261 | public function __toString(): string |
||
293 | |||
294 | public static function getTypeNameMap(): array |
||
302 | } |
||
303 |