Completed
Pull Request — develop (#27)
by Chris
20:10 queued 05:10
created

Uri::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;
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