Passed
Push — master ( bdfaf8...931c46 )
by smiley
01:33
created

ArchiveFile::__construct()   A

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 ArchiveFile
4
 *
5
 * @filesource   ArchiveFile.php
6
 * @created      28.04.2019
7
 * @package      codemasher\WildstarDB
8
 * @author       smiley <[email protected]>
9
 * @copyright    2019 smiley
10
 * @license      MIT
11
 */
12
13
namespace codemasher\WildstarDB;
14
15
class ArchiveFile extends ArchiveItemAbstract{
16
17
	public $Flags;
18
	public $Filetime;
19
	public $FileUtime;
20
	public $SizeUncompressed;
21
	public $SizeCompressed;
22
	public $Hash;
23
24
	public function __construct(array $data, string $parent){
25
		parent::__construct($data, $parent);
26
27
		$this->Hash      = \bin2hex($this->Hash);
28
		$this->FileUtime = (int)($this->Filetime/100000000);
29
#		$dt = (new \DateTime)->createFromFormat('U.u', $this->FileUtime) ?: (new \DateTime)->createFromFormat('U', $this->FileUtime);
30
#		$this->FileTimeStr = $dt->format(\DateTimeInterface::RFC3339_EXTENDED);
31
	}
32
33
}
34