Passed
Push — more_tests ( 238ec8...9836b6 )
by Fabrice
13:06
created

SetValuesTransformer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 20
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A exec() 0 7 2
1
<?php
2
3
/*
4
 * This file is part of YaEtl
5
 *     (c) Fabrice de Stefanis / https://github.com/fab2s/YaEtl
6
 * This source file is licensed under the MIT license which you will
7
 * find in the LICENSE file or at https://opensource.org/licenses/MIT
8
 */
9
10
namespace fab2s\YaEtl\Transformers\Arrays;
11
12
use fab2s\YaEtl\Transformers\TransformerAbstract;
13
14
class SetValuesTransformer extends TransformerAbstract
15
{
16
    /**
17
     * @var array<string,mixed>
18
     */
19
    protected $setUp = [];
20
21
    public function __construct(array $setup)
22
    {
23
        parent::__construct();
24
        $this->setUp = $setup;
25
    }
26
27
    public function exec($param = null)
28
    {
29
        foreach ($this->setUp as $key => $value) {
30
            $param[$key] = $value;
31
        }
32
33
        return $param;
34
    }
35
}
36