Completed
Pull Request — develop (#27)
by Chris
04:25
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
    /**
14
     * @var Chrisyue\PhpM3u8\M3u8\PropertyReader\PropertyReaderInterface
15
     */
16
    public $reader;
17
18
    /**
19
     * @var string
20
     */
21
    public $class;
22
23
    private $m3u8s;
24
25
    protected function getAttributeM3u8s()
26
    {
27
        if (null === $this->m3u8s) {
28
            $this->m3u8s = $this->reader->read($this->class, AttributeInterface::class);
29
        }
30
31
        return $this->m3u8s;
32
    }
33
34
    protected function initResult()
35
    {
36
        return new $this->class;
37
    }
38
}
39