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

AttributeList::getAttributeM3u8s()   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 0
1
<?php
2
3
namespace Chrisyue\PhpM3u8\M3u8\Transformer;
4
5
use Chrisyue\PhpM3u8\M3u8\Attribute\AttributeInterface;
6
use Chrisyue\PhpM3u8\M3u8\OptionsTrait;
7
8
/**
9
 * @Annotation
10
 */
11
class AttributeList extends AbstractAttributeList
12
{
13
    use OptionsTrait;
14
15
    private $m3u8s;
16
17
    protected function getAttributeM3u8s()
18
    {
19
        if (null === $this->m3u8s) {
20
            $this->m3u8s = $this->options['reader']->read($this->options['class'], AttributeInterface::class);
21
        }
22
23
        return $this->m3u8s;
24
    }
25
26
    protected function initResult()
27
    {
28
        return new $this->options['class']();
29
    }
30
}
31