Completed
Push — id3-metadata-objects ( a3a88a...ecc500 )
by Daniel
03:22
created

ExtendedHeader::setCrc32()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
/**
3
 * This file is part of the Metadata package.
4
 *
5
 * @author Daniel Schröder <[email protected]>
6
 */
7
8
namespace GravityMedia\Metadata\ID3v2;
9
10
use GravityMedia\Metadata\ID3v2\ExtendedHeaderInterface;
11
12
/**
13
 * ID3v2 extended header
14
 *
15
 * @package GravityMedia\Metadata\ID3v2
16
 */
17
class ExtendedHeader implements ExtendedHeaderInterface
18
{
19
    /**
20
     * @var int
21
     */
22
    protected $size;
23
24
    /**
25
     * @var array
26
     */
27
    protected $flags;
28
29
    /**
30
     * @var int
31
     */
32
    protected $padding;
33
34
    /**
35
     * @var int
36
     */
37
    protected $crc32;
38
39
    /**
40
     * @var int
41
     */
42
    protected $restrictions;
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function getSize()
48
    {
49
        return $this->size;
50
    }
51
52
    /**
53
     * Set size in bytes
54
     *
55
     * @param int $size
56
     *
57
     * @return $this
58
     */
59
    public function setSize($size)
60
    {
61
        $this->size = $size;
62
        return $this;
63
    }
64
65
    /**
66
     * {@inheritdoc}
67
     */
68
    public function isFlagEnabled($flag)
69
    {
70
        if (isset($this->flags[$flag])) {
71
            return $this->flags[$flag];
72
        }
73
74
        return false;
75
    }
76
77
    /**
78
     * Set flags
79
     *
80
     * @param array $flags
81
     *
82
     * @return $this
83
     */
84
    public function setFlags(array $flags)
85
    {
86
        $this->flags = $flags;
87
        return $this;
88
    }
89
90
    /**
91
     * {@inheritdoc}
92
     */
93
    public function getPadding()
94
    {
95
        return $this->padding;
96
    }
97
98
    /**
99
     * Set padding
100
     *
101
     * @param int $padding
102
     *
103
     * @return $this
104
     */
105
    public function setPadding($padding)
106
    {
107
        $this->padding = $padding;
108
        return $this;
109
    }
110
111
    /**
112
     * {@inheritdoc}
113
     */
114
    public function getCrc32()
115
    {
116
        return $this->crc32;
117
    }
118
119
    /**
120
     * Set CRC-32
121
     *
122
     * @param int $crc32
123
     *
124
     * @return $this
125
     */
126
    public function setCrc32($crc32)
127
    {
128
        $this->crc32 = $crc32;
129
        return $this;
130
    }
131
132
    /**
133
     * {@inheritdoc}
134
     */
135
    public function getRestrictions()
136
    {
137
        return $this->restrictions;
138
    }
139
140
    /**
141
     * Set restrictions
142
     *
143
     * @param int $restrictions
144
     *
145
     * @return $this
146
     */
147
    public function setRestrictions($restrictions)
148
    {
149
        $this->restrictions = $restrictions;
150
        return $this;
151
    }
152
}
153