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

MediaSegmentUri   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 26
c 0
b 0
f 0
rs 10

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
    use OptionsTrait;
14
15
    public function parse()
16
    {
17
        $lineInfo = $this->getStream()->read();
18
        if (isset($lineInfo['tag'])) {
19
            return;
20
        }
21
22
        return $lineInfo['value'];
23
    }
24
25
    public function dump($value)
26
    {
27
        $this->getStream()->write(['value' => $value]);
28
29
        return $this;
30
    }
31
32
    public function getSequence()
33
    {
34
        return $this->options['sequence'];
35
    }
36
}
37