Completed
Pull Request — develop (#27)
by Chris
10:40
created

FileStream::getLine()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Stream;
4
5
class FileStream extends AbstractStream
6
{
7
    private $file;
8
9
    public function __construct(\SplFileObject $file)
10
    {
11
        $this->file = $file;
12
    }
13
14
    public function next()
15
    {
16
        $this->file->next();
17
    }
18
19
    public function valid()
20
    {
21
        return $this->file->valid();
22
    }
23
24
    protected function getLine()
25
    {
26
        return trim($this->file->current());
27
    }
28
29
    protected function putLine($line)
30
    {
31
        $this->file->fwrite($line."\n");
32
    }
33
}
34