Completed
Pull Request — develop (#27)
by Chris
15:41 queued 43s
created

Uri   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 24
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;
4
5
/**
6
 * @Annotation
7
 * @Target("PROPERTY")
8
 */
9
class Uri extends AbstractM3u8 implements SequenceAwareInterface
10
{
11
    public function parse()
12
    {
13
        $lineInfo = $this->getStream()->read();
14
        if (isset($lineInfo['tag'])) {
15
            return $this;
16
        }
17
18
        return $this->setResult($lineInfo['value']);
19
    }
20
21
    public function dump()
22
    {
23
        $this->getStream()->write(['value' => $this->getResult()]);
24
25
        return $this;
26
    }
27
28
    public function getSequence()
29
    {
30
        return 999999;
31
    }
32
}
33