Completed
Push — develop ( dba330...cda2f3 )
by Chris
02:01
created

MediaSegment::getByteRange()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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\M3u8;
13
14
class MediaSegment
15
{
16
    protected $uri;
17
    protected $duration;
18
    protected $sequence;
19
    protected $isDiscontinuity;
20
    protected $title;
21
    protected $byteRange;
22
23 4
    public function __construct(
24
        $uri,
25
        $duration,
26
        $sequence,
27
        $isDiscontinuity = false,
28
        $title = null,
29
        \SplFixedArray $byteRange = null
30
    ) {
31 4
        $this->uri = $uri;
32 4
        $this->duration = $duration;
33 4
        $this->sequence = $sequence;
34 4
        $this->isDiscontinuity = $isDiscontinuity;
35 4
        $this->title = $title;
36 4
        $this->byteRange = $byteRange;
37 4
    }
38
39 2
    public function getUri()
40
    {
41 2
        return $this->uri;
42
    }
43
44 2
    public function getDuration()
45
    {
46 2
        return $this->duration;
47
    }
48
49 2
    public function getSequence()
50
    {
51 2
        return $this->sequence;
52
    }
53
54 2
    public function isDiscontinuity()
55
    {
56 2
        return $this->isDiscontinuity;
57
    }
58
59 2
    public function getTitle()
60
    {
61 2
        return $this->title;
62
    }
63
64
    /**
65
     * length: $byteRange[0],
66
     * offset: $byteRange[1].
67
     *
68
     * @return \SplFixedArray|null
69
     */
70 2
    public function getByteRange()
71
    {
72 2
        return $this->byteRange;
73
    }
74
}
75