Passed
Push — master ( e5a117...444e05 )
by Paweł
09:40
created

ArrayHelper   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 10
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A arrayMap() 0 8 2
1
<?php
2
/**
3
 * Created for IG Monitoring.
4
 * User: jakim <[email protected]>
5
 * Date: 11.01.2018
6
 */
7
8
namespace app\components;
9
10
11
use yii\helpers\BaseArrayHelper;
12
13
class ArrayHelper extends BaseArrayHelper
14
{
15
    public static function arrayMap($data, array $map): array
16
    {
17
        $res = [];
18
        foreach ($map as $to => $from) {
19
            $res[$to] = static::getValue($data, $from);
20
        }
21
22
        return $res;
23
    }
24
}