Completed
Pull Request — develop (#27)
by Chris
02:13
created

MediaSegmentUri::parse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
c 0
b 0
f 0
rs 9.6666
cc 2
eloc 5
nc 2
nop 0
1
<?php
2
3
namespace Chrisyue\PhpM3u8\M3u8\Core;
4
5
/**
6
 * @Annotation
7
 */
8
class MediaSegmentUri extends AbstractCore implements ChildCoreInterface
9
{
10
    /**
11
     * @var int
12
     */
13
    public $sequence;
14
15
    public function parse()
16
    {
17
        $lineInfo = $this->getLines()->read();
18
        if (isset($lineInfo['tag'])) {
19
            return;
20
        }
21
22
        return $lineInfo['value'];
23
    }
24
25
    public function dump($value)
26
    {
27
        $this->getLines()->write(['value' => $value]);
28
29
        return $this;
30
    }
31
32
    public function getSequence()
33
    {
34
        return $this->sequence;
35
    }
36
}
37