Completed
Pull Request — develop (#27)
by Chris
01:52
created

AbstractTransformer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 15
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A transform() 0 10 2
doTransform() 0 1 ?
1
<?php
2
3
namespace Chrisyue\PhpM3u8\Transformer;
4
5
abstract class AbstractTransformer implements TransformerInterface
6
{
7
    public function transform($origin)
8
    {
9
        if (!$this->supports($origin)) {
10
            trigger_error(sprintf('Non-supported type for transformation'), E_USER_WARNING);
11
12
            return $origin;
13
        }
14
15
        return $this->doTransform($origin);
16
    }
17
18
    abstract protected function doTransform($origin);
19
}
20