Completed
Pull Request — develop (#27)
by Chris
04:25
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
use Chrisyue\PhpM3u8\M3u8\OptionsTrait;
6
7
/**
8
 * @Annotation
9
 */
10
class MediaSegmentUri extends AbstractCore implements ChildCoreInterface
11
{
12
    /**
13
     * @var int
14
     */
15
    public $sequence;
16
17
    public function parse()
18
    {
19
        $lineInfo = $this->getLines()->read();
20
        if (isset($lineInfo['tag'])) {
21
            return;
22
        }
23
24
        return $lineInfo['value'];
25
    }
26
27
    public function dump($value)
28
    {
29
        $this->getLines()->write(['value' => $value]);
30
31
        return $this;
32
    }
33
34
    public function getSequence()
35
    {
36
        return $this->sequence;
37
    }
38
}
39