Passed
Push — develop ( 493714...dd5809 )
by nguereza
01:37
created

ArchiveInfo::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 5
1
<?php
2
3
/**
4
 * Platine Docx template
5
 *
6
 * Platine Docx template is the lightweight library to manipulate the content of .docx files
7
 *
8
 * This content is released under the MIT License (MIT)
9
 *
10
 * Copyright (c) 2020 Platine Docx template
11
 *
12
 * Permission is hereby granted, free of charge, to any person obtaining a copy
13
 * of this software and associated documentation files (the "Software"), to deal
14
 * in the Software without restriction, including without limitation the rights
15
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
 * copies of the Software, and to permit persons to whom the Software is
17
 * furnished to do so, subject to the following conditions:
18
 *
19
 * The above copyright notice and this permission notice shall be included in all
20
 * copies or substantial portions of the Software.
21
 *
22
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
 * SOFTWARE.
29
 */
30
31
/**
32
 *  @file ArchiveInfo.php
33
 *
34
 *  The Archive file or directory info class
35
 *
36
 *  @package    Platine\DocxTemplate\Archive
37
 *  @author Platine Developers Team
38
 *  @copyright  Copyright (c) 2020
39
 *  @license    http://opensource.org/licenses/MIT  MIT License
40
 *  @link   http://www.iacademy.cf
41
 *  @version 1.0.0
42
 *  @filesource
43
 */
44
45
declare(strict_types=1);
46
47
namespace Platine\DocxTemplate\Archive;
48
49
/**
50
 * @class ArchiveInfo
51
 * @package Platine\DocxTemplate\Archive
52
 */
53
class ArchiveInfo
54
{
55
    /**
56
     * The archive name
57
     * @var string
58
     */
59
    protected string $name;
60
61
    /**
62
     * The position in archive
63
     * @var int
64
     */
65
    protected int $index;
66
67
    /**
68
     * The size
69
     * @var int
70
     */
71
    protected int $size;
72
73
    /**
74
     * The modification time
75
     * @var int
76
     */
77
    protected int $mtime;
78
79
    /**
80
     * The control value
81
     * @var int
82
     */
83
    protected int $crc;
84
85
    /**
86
     * Create new instance
87
     * @param string $name
88
     * @param int $index
89
     * @param int $size
90
     * @param int $mtime
91
     * @param int $crc
92
     */
93
    public function __construct(string $name, int $index, int $size, int $mtime, int $crc)
94
    {
95
        $this->name = $name;
96
        $this->index = $index;
97
        $this->size = $size;
98
        $this->mtime = $mtime;
99
        $this->crc = $crc;
100
    }
101
102
    /**
103
     * Return the name
104
     * @return string
105
     */
106
    public function getName(): string
107
    {
108
        return $this->name;
109
    }
110
111
    /**
112
     * Return the index
113
     * @return int
114
     */
115
    public function getIndex(): int
116
    {
117
        return $this->index;
118
    }
119
120
    /**
121
     * Return the size
122
     * @return int
123
     */
124
    public function getSize(): int
125
    {
126
        return $this->size;
127
    }
128
129
    /**
130
     * Return the modification time
131
     * @return int
132
     */
133
    public function getMtime(): int
134
    {
135
        return $this->mtime;
136
    }
137
138
    /**
139
     * Return the control value
140
     * @return int
141
     */
142
    public function getCrc(): int
143
    {
144
        return $this->crc;
145
    }
146
}
147