DiscontinuityTag::read()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the PhpM3u8 package.
5
 *
6
 * (c) Chrisyue <http://chrisyue.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Chrisyue\PhpM3u8\Tag;
13
14
class DiscontinuityTag extends AbstractTag
15
{
16
    private $discontinuity = false;
17
18
    const TAG_IDENTIFIER = '#EXT-X-DISCONTINUITY';
19
20 1
    public function setDiscontinuity($discontinuity)
21
    {
22 1
        $this->discontinuity = $discontinuity;
23
24 1
        return $this;
25
    }
26
27 1
    public function isDiscontinuity()
28
    {
29 1
        return $this->discontinuity;
30
    }
31
32 1
    public function dump()
33
    {
34 1
        if ($this->discontinuity) {
35 1
            return self::TAG_IDENTIFIER;
36
        }
37 1
    }
38
39 1
    protected function read($line)
40
    {
41 1
        $this->discontinuity = true;
42 1
    }
43
}
44