Transformer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A boot() 0 2 1
1
<?php
2
3
namespace Ghc\Rosetta\Transformers;
4
5
use Ghc\Rosetta\Configurable;
6
7
abstract class Transformer
8
{
9
    use Configurable;
10
11
    /**
12
     * Connector constructor.
13
     *
14
     * @param array $config
15
     */
16
    public function __construct($config = [])
17
    {
18
        $this->setConfig($config);
19
20
        $this->addDefaultConfig([
21
            'properties' => [],
22
        ]);
23
24
        $this->boot();
25
    }
26
27
    /**
28
     * Boot Transformer.
29
     */
30
    protected function boot()
31
    {
32
    }
33
34
    /**
35
     * @param array $data
36
     *
37
     * @return array
38
     */
39
    abstract public function transform($data);
40
}
41