EndOfCentralDirectory::getCdSize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace PhpZip\Model;
4
5
/**
6
 * End of Central Directory.
7
 *
8
 * @author Ne-Lexa [email protected]
9
 * @license MIT
10
 */
11
class EndOfCentralDirectory
12
{
13
    /** @var int Count files. */
14
    private $entryCount;
15
16
    /** @var int Central Directory Offset. */
17
    private $cdOffset;
18
19
    /** @var int */
20
    private $cdSize;
21
22
    /** @var string|null The archive comment. */
23
    private $comment;
24
25
    /** @var bool Zip64 extension */
26
    private $zip64;
27
28
    /**
29
     * EndOfCentralDirectory constructor.
30
     *
31
     * @param int         $entryCount
32
     * @param int         $cdOffset
33
     * @param int         $cdSize
34
     * @param bool        $zip64
35
     * @param string|null $comment
36
     */
37 137
    public function __construct($entryCount, $cdOffset, $cdSize, $zip64, $comment = null)
38
    {
39 137
        $this->entryCount = $entryCount;
40 137
        $this->cdOffset = $cdOffset;
41 137
        $this->cdSize = $cdSize;
42 137
        $this->zip64 = $zip64;
43 137
        $this->comment = $comment;
44 137
    }
45
46
    /**
47
     * @param string|null $comment
48
     */
49 1
    public function setComment($comment)
50
    {
51 1
        $this->comment = $comment;
52 1
    }
53
54
    /**
55
     * @return int
56
     */
57 137
    public function getEntryCount()
58
    {
59 137
        return $this->entryCount;
60
    }
61
62
    /**
63
     * @return int
64
     */
65 137
    public function getCdOffset()
66
    {
67 137
        return $this->cdOffset;
68
    }
69
70
    /**
71
     * @return int
72
     */
73 137
    public function getCdSize()
74
    {
75 137
        return $this->cdSize;
76
    }
77
78
    /**
79
     * @return string|null
80
     */
81 136
    public function getComment()
82
    {
83 136
        return $this->comment;
84
    }
85
86
    /**
87
     * @return bool
88
     */
89
    public function isZip64()
90
    {
91
        return $this->zip64;
92
    }
93
}
94