ArchiveEntry   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 17
c 2
b 0
f 0
dl 0
loc 45
ccs 10
cts 10
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 18 2
1
<?php
2
3
namespace wapmorgan\UnifiedArchive;
4
5
/**
6
 * Information class. Represent information about concrete file in archive.
7
 *
8
 * @package wapmorgan\UnifiedArchive
9
 */
10
class ArchiveEntry
11
{
12
    /** @var string Path of archive entry */
13
    public $path;
14
    /** @var int Size of packed entry in bytes */
15
    public $compressedSize;
16
    /** @var int Size of unpacked entry in bytes */
17
    public $uncompressedSize;
18
    /** @var int Time of entry modification in unix timestamp format. */
19
    public $modificationTime;
20
    /** @var bool */
21
    public $isCompressed;
22
    /** @var string Comment */
23
    public $comment;
24
    /** @var string|null Control check summ */
25
    public $crc32;
26
27
    /**
28
     * ArchiveEntry constructor.
29
     * @param string $path
30
     * @param int $compressedSize
31
     * @param int $uncompressedSize
32
     * @param int $modificationTime
33 6
     * @param bool|null $isCompressed
34
     * @param string|null $comment
35 6
     * @param string|null $crc32
36 6
     */
37 6
    public function __construct(
38 6
        $path,
39 6
        $compressedSize,
40 1
        $uncompressedSize,
41 6
        $modificationTime,
42 6
        $isCompressed = null,
43 6
        $comment = null,
44
        $crc32 = null)
45
    {
46
        $this->path = $path;
47
        $this->compressedSize = $compressedSize;
48
        $this->uncompressedSize = $uncompressedSize;
49
        $this->modificationTime = $modificationTime;
50
        if ($isCompressed === null)
51
            $isCompressed = $uncompressedSize !== $compressedSize;
52
        $this->isCompressed = $isCompressed;
53
        $this->comment = $comment;
54
        $this->crc32 = $crc32;
55
    }
56
}
57