EndOfCentralDirectory   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 81
Duplicated Lines 0 %

Test Coverage

Coverage 90%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 17
dl 0
loc 81
ccs 18
cts 20
cp 0.9
rs 10
c 1
b 0
f 1
wmc 7

7 Methods

Rating   Name   Duplication   Size   Complexity  
A isZip64() 0 3 1
A getEntryCount() 0 3 1
A __construct() 0 7 1
A getComment() 0 3 1
A setComment() 0 3 1
A getCdSize() 0 3 1
A getCdOffset() 0 3 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