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

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