Completed
Push — id3-metadata-objects ( c855dc...168cf3 )
by Daniel
03:05
created

Frame::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
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
/**
11
 * ID3v2 frame class.
12
 *
13
 * @package GravityMedia\Metadata
14
 */
15
class Frame
16
{
17
    /**
18
     * @var string
19
     */
20
    protected $name;
21
22
    /**
23
     * @var int
24
     */
25
    protected $dataLength;
26
27
    /**
28
     * @var string
29
     */
30
    protected $data;
31
32
    /**
33
     * Create ID3v2 frame object.
34
     */
35
    public function __construct()
36
    {
37
        $this->dataLength = 0;
38
    }
39
40
    /**
41
     * Get name.
42
     *
43
     * @return string
44
     */
45
    public function getName()
46
    {
47
        return $this->name;
48
    }
49
50
    /**
51
     * Set name.
52
     *
53
     * @param string $name
54
     *
55
     * @return $this
56
     */
57
    public function setName($name)
58
    {
59
        $this->name = $name;
60
        return $this;
61
    }
62
63
    /**
64
     * Get data length.
65
     *
66
     * @return int
67
     */
68
    public function getDataLength()
69
    {
70
        return $this->dataLength;
71
    }
72
73
    /**
74
     * Set data length.
75
     *
76
     * @param int $dataLength
77
     *
78
     * @return $this
79
     */
80
    public function setDataLength($dataLength)
81
    {
82
        $this->dataLength = $dataLength;
83
        return $this;
84
    }
85
86
    /**
87
     * Get data.
88
     *
89
     * @return string
90
     */
91
    public function getData()
92
    {
93
        return $this->data;
94
    }
95
96
    /**
97
     * Set data.
98
     *
99
     * @param string $data
100
     *
101
     * @return $this
102
     */
103
    public function setData($data)
104
    {
105
        $this->data = $data;
106
        return $this;
107
    }
108
}
109