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

AttributeList::initResult()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
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