DiscontinuityTag   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 30
ccs 12
cts 12
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A isDiscontinuity() 0 4 1
A dump() 0 6 2
A read() 0 4 1
A setDiscontinuity() 0 6 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