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

AttributeList   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

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