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

SplittedAttrString   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createTransformer() 0 7 1
A createReverser() 0 4 1
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Transformer\Factory\Annotation;
4
5
use Chrisyue\PhpM3u8\Transformer\Factory\FactoryInterface;
6
use Chrisyue\PhpM3u8\Transformer\ChainTransformer;
7
use Chrisyue\PhpM3u8\Transformer\QuotedStringTransformer;
8
use Chrisyue\PhpM3u8\Transformer\DelimiterTransformer;
9
10
/**
11
 * @Annotation
12
 */
13
class SplittedAttrString implements FactoryInterface
14
{
15
    private $delimiter;
16
17
    public function __construct(array $options)
18
    {
19
        $this->delimiter = $options['splitter'];
20
    }
21
22
    public function createTransformer()
23
    {
24
        return new ChainTransformer([
25
            new QuotedStringTransformer(),
26
            new DelimiterTransformer($this->delimiter),
27
        ]);
28
    }
29
30
    public function createReverser()
31
    {
32
        
33
    }
34
}
35