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