Completed
Push — d64 ( a95f31...4968c1 )
by Welling
02:45
created

helpers.php ➔ to_name_value()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 7
nc 3
nop 2
dl 0
loc 11
ccs 0
cts 7
cp 0
crap 12
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('get_user_timezone')) {
4
    function get_user_timezone()
5
    {
6
        return 'UTC';
7
    }
8
}
9
10
if (!function_exists('to_name_value')) {
11
    function to_name_value($array, $keys = null)
12
    {
13
        $data = [];
14
        foreach ($array as $name => $value) {
15
            $row = ['name' => $name, 'value' => $value];
16
            if (isset($keys)) $row = array_merge($row, $keys);
17
            array_push($data, $row);
18
        }
19
20
        return $data;
21
    }
22
}