Completed
Pull Request — develop (#27)
by Chris
12:14
created

AttributeList   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getAttributeM3u8s() 0 8 2
A initResult() 0 4 1
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