Completed
Pull Request — develop (#27)
by Chris
12:14
created

MediaSegmentUri   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 2
dl 0
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A parse() 0 9 2
A dump() 0 6 1
A getSequence() 0 4 1
1
<?php
2
3
namespace Chrisyue\PhpM3u8\M3u8\Core;
4
5
use Chrisyue\PhpM3u8\M3u8\OptionsTrait;
6
7
/**
8
 * @Annotation
9
 * @Target("PROPERTY")
10
 */
11
class MediaSegmentUri extends AbstractCore implements ChildCoreInterface
12
{
13
    /**
14
     * @var int
15
     */
16
    public $sequence;
17
18
    public function parse()
19
    {
20
        $lineInfo = $this->getLines()->read();
21
        if (isset($lineInfo['tag'])) {
22
            return;
23
        }
24
25
        return $lineInfo['value'];
26
    }
27
28
    public function dump($value)
29
    {
30
        $this->getLines()->write(['value' => $value]);
31
32
        return $this;
33
    }
34
35
    public function getSequence()
36
    {
37
        return $this->sequence;
38
    }
39
}
40