Completed
Pull Request — develop (#27)
by Chris
13:09
created

FileParser::parse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Parser;
4
5
class FileParser
6
{
7
    private $parser;
8
9
    public function __construct(Parser $parser)
10
    {
11
        $this->parser = $parser;
12
    }
13
14
    public function parse(\SplFileObject $file)
15
    {
16
        while (!$file->eof()) {
17
            $this->parser->parseLine($file->fgets());
18
        }
19
20
        return $this->parser->getPlaylist();
21
    }
22
}
23