File::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 2
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Class File
4
 *
5
 * @filesource   File.php
6
 * @created      28.04.2019
7
 * @package      codemasher\WildstarDB\Archive
8
 * @author       smiley <[email protected]>
9
 * @copyright    2019 smiley
10
 * @license      MIT
11
 */
12
13
namespace codemasher\WildstarDB\Archive;
14
15
use function bin2hex;
16
17
final class File extends ItemAbstract{
18
19
	/** @var int */
20
	public $Flags;
21
	/** @var int */
22
	public $Filetime;
23
	/** @var int */
24
	public $FileUtime;
25
	/** @var int */
26
	public $SizeUncompressed;
27
	/** @var int */
28
	public $SizeCompressed;
29
	/** @var string */
30
	public $Hash;
31
32
	/**
33
	 * File constructor.
34
	 *
35
	 * @param array  $data
36
	 * @param string $parent
37
	 */
38
	public function __construct(array $data, string $parent){
39
		parent::__construct($data, $parent);
40
41
		$this->Hash      = bin2hex($this->Hash);
42
		$this->FileUtime = (int)($this->Filetime / 100000000);
43
#		$dt = (new \DateTime)->createFromFormat('U.u', $this->FileUtime) ?: (new \DateTime)->createFromFormat('U', $this->FileUtime);
44
#		$this->FileTimeStr = $dt->format(\DateTimeInterface::RFC3339_EXTENDED);
45
	}
46
47
}
48