Transformer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 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